terminatorrc isn't created by default, so it can be used to override the gnome-terminal profile as well as providing gconf independence for non-gnome users

This commit is contained in:
Chris Jones 2008-03-01 00:24:14 +00:00
parent 201e48c9be
commit 4b6094fbe5
1 changed files with 15 additions and 14 deletions

View File

@ -145,22 +145,23 @@ class TerminatorTerm:
if self.profile: if self.profile:
self.gconf_client.add_dir (self.profile, gconf.CLIENT_PRELOAD_RECURSIVE) self.gconf_client.add_dir (self.profile, gconf.CLIENT_PRELOAD_RECURSIVE)
self.gconf_client.notify_add (self.profile, self.on_gconf_notification) self.gconf_client.notify_add (self.profile, self.on_gconf_notification)
else:
if os.path.exists (pwd.getpwuid(os.getuid ())[5] + "/.terminatorrc"):
f = open (pwd.getpwuid (os.getuid ())[5] + "/.terminatorrc")
config = f.readlines ()
f.close ()
for line in config: if os.path.exists (pwd.getpwuid(os.getuid ())[5] + "/.terminatorrc"):
try: f = open (pwd.getpwuid (os.getuid ())[5] + "/.terminatorrc")
line = line.split("#")[0] config = f.readlines ()
line = line.strip () f.close ()
if line:
(key,value) = line.split ("=") for line in config:
print >> sys.stderr, _('''Overriding setting '%s' from default value '%s' to: '%s' ''')%(key.strip (), self.defaults[key.strip ()], value.strip ()) try:
self.defaults[key.strip ()] = value.strip () line = line.strip ()
except: if line[0] == '#':
pass pass
elif line:
(key,value) = line.split ("=")
print >> sys.stderr, _('''Overriding setting '%s' from value '%s' to: '%s' ''')%(key.strip (), self.defaults[key.strip ()], value.strip ())
self.defaults[key.strip ()] = value.strip ()
except:
pass
self.gconf_client.add_dir ('/apps/metacity/general', gconf.CLIENT_PRELOAD_RECURSIVE) self.gconf_client.add_dir ('/apps/metacity/general', gconf.CLIENT_PRELOAD_RECURSIVE)
self.gconf_client.notify_add ('/apps/metacity/general/focus_mode', self.on_gconf_notification) self.gconf_client.notify_add ('/apps/metacity/general/focus_mode', self.on_gconf_notification)