Created
May 24, 2019 06:45
-
-
Save sardaukar/92c4cebf0a4a4d2d52011446f5200926 to your computer and use it in GitHub Desktop.
GNOME desktop picture changer
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/env ruby | |
DIR = "/home/sardaukar/Pictures/Homeworld" | |
SLEEP_IN_SECONDS = 300 | |
trap("INT") { exit 0 } | |
loop do | |
file = Dir.entries(DIR).select {|d| d.index("jpg")}.sample | |
system("gsettings set org.gnome.desktop.background picture-options 'zoom'") | |
system("gsettings set org.gnome.desktop.background picture-uri '#{DIR}/#{file}'") | |
sleep SLEEP_IN_SECONDS | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment