Skip to content

Instantly share code, notes, and snippets.

@sardaukar
Created May 24, 2019 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sardaukar/92c4cebf0a4a4d2d52011446f5200926 to your computer and use it in GitHub Desktop.
Save sardaukar/92c4cebf0a4a4d2d52011446f5200926 to your computer and use it in GitHub Desktop.
GNOME desktop picture changer
#!/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