From b31c987cc85d1ae7dc132851ef0957f5379cd272 Mon Sep 17 00:00:00 2001 From: Peter Fern Date: Sat, 9 Mar 2013 20:05:31 +1100 Subject: [PATCH] Add XDG_CONFIG_DIRS to config_paths for system-wide install Commonly this will be `/etc/xdg/powerline` --- powerline/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/powerline/__init__.py b/powerline/__init__.py index e92af7c5..7a2eb5c8 100644 --- a/powerline/__init__.py +++ b/powerline/__init__.py @@ -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.