Skip to content

Instantly share code, notes, and snippets.

@cutalion
Created April 17, 2011 11:42
Show Gist options
  • Save cutalion/923970 to your computer and use it in GitHub Desktop.
Save cutalion/923970 to your computer and use it in GitHub Desktop.
Allows add or remove icons to unity panel white-list, so that they can be show on unity panel
require 'rubygems'
require 'json'
def save_settings(settings)
`gsettings set com.canonical.Unity.Panel systray-whitelist "#{settings.to_json.gsub('"', "'")}"`
end
def current_settings
settings = `gsettings get com.canonical.Unity.Panel systray-whitelist`
JSON.parse(settings.gsub("'", '"'))
end
command = ARGV.shift
case command
when 'get' then
puts current_settings
when 'add' then
save_settings(current_settings + ARGV)
puts "Current settings:"
puts current_settings
when 'remove' then
save_settings(current_settings - ARGV)
puts "Current settings:"
puts current_settings
else
puts "Unknown command. Available commands are: get, add, remove."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment