Simply changes your nitrogen desktop wallpaper to a random image from provided folder.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
392 B

#!/bin/bash
BGSAVED=/home/<user>/.config/nitrogen/bg-saved.cfg
WALLPAPERS=/home/<user>/Pictures/wallpapers/
MODE=4
export DISPLAY=:0
FILENAME="$(ls ${WALLPAPERS} | shuf -n 1)"
echo '[xin_0]' > ${BGSAVED}
echo "file=${WALLPAPERS}/${FILENAME}" >> ${BGSAVED}
echo "mode=${MODE}" >> ${BGSAVED}
echo 'bgcolor=#000000' >> ${BGSAVED}
/usr/bin/nitrogen --restore
# or just
# nitrogen --restore