Skip to content

Instantly share code, notes, and snippets.

@AnwarShah
Created September 15, 2018 18:19
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 AnwarShah/6858371f195464925b19fceeed098d63 to your computer and use it in GitHub Desktop.
Save AnwarShah/6858371f195464925b19fceeed098d63 to your computer and use it in GitHub Desktop.
Change GTK theme once per minute
#!/usr/bin/ruby
themes_dir = Dir["/usr/share/themes/*"].select do |entry|
File.directory?(entry) && File.exists?(entry + "/index.theme") && File.exist?(entry + "/gtk-3.0")
end.sort!
theme_names = themes_dir.sort.map { |dir| File.basename(dir) }
theme_names.each do |theme_name|
sleep 60 # 60 is 1 minute. Change it according to your need.
puts "Changing theme to #{theme_name}"
system("gsettings set org.gnome.desktop.interface gtk-theme '#{theme_name}'")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment