Add XDG_CONFIG_DIRS to config_paths for system-wide install

Commonly this will be `/etc/xdg/powerline`
This commit is contained in:
Peter Fern 2013-03-09 20:05:31 +11:00 committed by Kim Silkebækken
parent 8e8e9c9edc
commit b31c987cc8

View File

@ -78,8 +78,13 @@ class Powerline(object):
'''
config_home = os.environ.get('XDG_CONFIG_HOME', os.path.join(os.path.expanduser('~'), '.config'))
config_path = os.path.join(config_home, 'powerline')
config_paths = [config_path]
config_dirs = os.environ.get('XDG_CONFIG_DIRS', None)
if config_dirs is not None:
config_paths.extend([os.path.join(d, 'powerline') for d in config_dirs.split(':')])
plugin_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), 'config_files')
return [config_path, plugin_path]
config_paths.append(plugin_path)
return config_paths
def load_theme_config(self, name):
'''Get theme configuration.