Skip to content

Instantly share code, notes, and snippets.

@gjergjsheldija
Created February 21, 2012 12:45
Show Gist options
  • Save gjergjsheldija/1876337 to your computer and use it in GitHub Desktop.
Save gjergjsheldija/1876337 to your computer and use it in GitHub Desktop.
gconf-watcher
#!/usr/bin/env python
###
# Print out changes to the environment
###
import gtk, gconf
def key_to_tool(entry):
v = entry.value
try:
return 'gconftool --set %s "%s" -t %s' % (entry.key, v.to_string(), v.type.value_nick)
except:
return "# Couldn't understand setting %s" % entry.key
def key_changed_callback(client, cnxn_id, entry, other):
print key_to_tool(entry)
client = gconf.client_get_default()
client.add_dir('/',
gconf.CLIENT_PRELOAD_NONE)
client.notify_add('/', key_changed_callback, 1)
gtk.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment