Last active
April 20, 2020 13:33
-
-
Save lucivaldo/bfc36fdf6829c7bd5b886f89b62bd407 to your computer and use it in GitHub Desktop.
Script Ruby para alterar o Wallpaper
This file contains 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/env ruby | |
module ChangeWallpaper | |
HOME = ENV['HOME'] | |
PICTURES_PATH = HOME + '/Pictures' | |
WALLPAPERS_PATH = PICTURES_PATH + '/Wallpapers' | |
def self.change | |
wallpaper = Dir.glob("#{WALLPAPERS_PATH}/**/*").sample | |
command = "gsettings set org.gnome.desktop.background picture-uri #{wallpaper}" | |
system(command) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment