Last active
November 2, 2017 11:09
-
-
Save Endika/f50fd9dae95be30493b62e1352b9eb51 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
user=$(whoami) | |
fl=$(find /proc -maxdepth 2 -user $user -name environ -print -quit) | |
for i in {1..5} | |
do | |
fl=$(find /proc -maxdepth 2 -user $user -name environ -newer "$fl" -print -quit) | |
done | |
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS "$fl" | cut -d= -f2-) | |
PICS_PATH="/home/endika/Dropbox/wallpapers/" | |
IMG=$(find -L $PICS_PATH -name "*.jpg" -o -name "*.png" | shuf -n1) | |
# gsettings set org.gnome.desktop.background picture-uri "file://${IMG}" | |
dconf write "/org/gnome/desktop/background/picture-uri" "'file://${IMG}'" | |
echo -e "$(date): ${IMG}" >> /tmp/wallch.log | |
# crontab | |
# * * * * * bash ~/Dropbox/random-background.sh | |
# * * * * * sleep 10 ; bash ~/Dropbox/random-background.sh | |
# * * * * * sleep 20 ; bash ~/Dropbox/random-background.sh | |
# * * * * * sleep 30 ; bash ~/Dropbox/random-background.sh | |
# * * * * * sleep 40 ; bash ~/Dropbox/random-background.sh | |
# * * * * * sleep 50 ; bash ~/Dropbox/random-background.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment