Created
September 15, 2018 18:19
-
-
Save AnwarShah/6858371f195464925b19fceeed098d63 to your computer and use it in GitHub Desktop.
Change GTK theme once per minute
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
#!/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