Since gnome-terminal now seems to set a global key with the list of profiles it knows about, we don't need to walk the profile directory ourselves, which seems like a good plan
This commit is contained in:
parent
ec51a1e865
commit
71f07637ac
12
terminator
12
terminator
|
@ -38,7 +38,8 @@ class TerminatorTerm:
|
||||||
# Our settings
|
# Our settings
|
||||||
# FIXME: Add commandline and/or gconf options to change these
|
# FIXME: Add commandline and/or gconf options to change these
|
||||||
defaults = {
|
defaults = {
|
||||||
'profile_dir' : '/apps/gnome-terminal/profiles',
|
'gt_dir' : '/apps/gnome-terminal',
|
||||||
|
'_profile_dir' : '%s/profiles',
|
||||||
'allow_bold' : True,
|
'allow_bold' : True,
|
||||||
'audible_bell' : False,
|
'audible_bell' : False,
|
||||||
'background' : None,
|
'background' : None,
|
||||||
|
@ -69,15 +70,18 @@ class TerminatorTerm:
|
||||||
matches = {}
|
matches = {}
|
||||||
|
|
||||||
def __init__ (self, term, profile):
|
def __init__ (self, term, profile):
|
||||||
|
self.defaults['profile_dir'] = self.defaults['_profile_dir']%(self.defaults['gt_dir'])
|
||||||
self.defaults['link_user'] = self.defaults['_link_user']%(self.defaults['link_userchars'], self.defaults['link_passchars'])
|
self.defaults['link_user'] = self.defaults['_link_user']%(self.defaults['link_userchars'], self.defaults['link_passchars'])
|
||||||
|
|
||||||
self.term = term
|
self.term = term
|
||||||
self.gconf_client = gconf.client_get_default ()
|
self.gconf_client = gconf.client_get_default ()
|
||||||
|
|
||||||
self.profile = None
|
self.profile = None
|
||||||
for dir in self.gconf_client.all_dirs(self.defaults['profile_dir']):
|
profiles = self.gconf_client.get_list (self.defaults['gt_dir'] + '/global/profile_list', 'string')
|
||||||
if self.gconf_client.get_string (dir + "/visible_name") == profile:
|
|
||||||
self.profile = dir
|
for item in profiles:
|
||||||
|
if item == profile:
|
||||||
|
self.profile = '%s/%s'%(self.defaults['profile_dir'], item)
|
||||||
break
|
break
|
||||||
|
|
||||||
if self.profile == None:
|
if self.profile == None:
|
||||||
|
|
Loading…
Reference in New Issue