This commit is contained in:
NaiJi ✨ 2021-08-14 19:20:49 +03:00
commit bd912e0112
2 changed files with 30 additions and 0 deletions

12
README.md Normal file
View File

@ -0,0 +1,12 @@
# Nitrogen Random
Simply changes your nitrogen desktop wallpaper to a random image from provided folder.
### How to run ###
Edit the script and make all variables valid:
BGSAVED is the path to bg-saved.cfg of nitrogen, must be in your .config/nitrogen folder.
WALLPAPERS is the path to a folder where all your wallpapers are located.
You may also put it to crontab.

18
nitrogen-random.sh Normal file
View File

@ -0,0 +1,18 @@
#!/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