Skip to content

Instantly share code, notes, and snippets.

@lucivaldo
Last active April 20, 2020 13:33
Show Gist options
  • Save lucivaldo/bfc36fdf6829c7bd5b886f89b62bd407 to your computer and use it in GitHub Desktop.
Save lucivaldo/bfc36fdf6829c7bd5b886f89b62bd407 to your computer and use it in GitHub Desktop.
Script Ruby para alterar o Wallpaper
#!/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