Last active
July 28, 2024 22:44
-
-
Save awls99/7d27f66f3e0e9d965ca4f49ebc2d0dde to your computer and use it in GitHub Desktop.
Ubuntu random wallpaper
This file contains hidden or 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/sh | |
| # */5 * * * * /bin/sh /home/arthur/wallpaperShuffle.sh > /tmp/cronjob.log 2>&1 | |
| REAL_UID=$(id --real --user) | |
| PID=$(pgrep --euid $REAL_UID gnome-session | head -n 1) | |
| export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2- | sed -e "s/\x0//g") | |
| PIC=$(ls /media/arthur/Fast\ Stuff/Cloudbox/Ultrawide\ wallpapers/* | shuf -n1 ) | |
| echo $PIC > /home/arthur/log | |
| gsettings set org.gnome.desktop.background picture-uri "file://$PIC" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment