Created
August 8, 2012 07:15
-
-
Save kaorimatz/3293038 to your computer and use it in GitHub Desktop.
Dumping gnome-terminal's profile settings
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
#!/bin/env python | |
def main(name): | |
import gconf | |
import pickle | |
client = gconf.Client() | |
for p in client.all_dirs('/apps/gnome-terminal/profiles'): | |
visible_name = client.get_value('%s/visible_name' % p) | |
print name | |
if name != visible_name: | |
continue | |
entries = {} | |
for e in client.all_entries(p): | |
value = client.get_value(e.key) | |
entries[e.key] = value | |
print 'Dumping all entries of "%s"' % visible_name | |
with open(visible_name + '.pickle', 'wb') as f: | |
pickle.dump(entries, f) | |
if __name__ == '__main__': | |
import sys | |
if len(sys.argv) != 2: | |
print 'usage: %s PROFILE_NAME' % sys.argv[0] | |
exit() | |
main(sys.argv[1]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment