diff --git a/blueman/plugins/config/File.py b/blueman/plugins/config/File.py index c5414c5..9a9e156 100644 --- a/blueman/plugins/config/File.py +++ b/blueman/plugins/config/File.py @@ -37,7 +37,12 @@ signal.signal(signal.SIGHUP, sighandler) dbus.service.Object.SUPPORTS_MULTIPLE_OBJECT_PATHS = True -cfg_path = os.path.expanduser('~/.config/blueman/blueman.cfg') +cfg_dir = os.path.expanduser('~/.config/blueman') + +if os.environ.has_key('XDG_CONFIG_HOME'): + cfg_dir = '%s/blueman' % os.environ['XDG_CONFIG_HOME'] + +cfg_path = '%s/blueman.cfg' % cfg_dir class Monitor(dbus.service.Object): __id__ = 0 @@ -89,9 +94,9 @@ class File(ConfigPlugin): def on_load(self, section): if not File.__db__: - if not os.path.exists(os.path.expanduser('~/.config/blueman')): + if not os.path.exists(os.path.expanduser(cfg_dir)): try: - os.makedirs(os.path.expanduser('~/.config/blueman')) + os.makedirs(os.path.expanduser(cfg_dir)) except: pass try: