summaryrefslogtreecommitdiff
blob: 62724db1c8e3bf4b0e9bb6241eace920c90f3501 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
diff --git a/blueman/plugins/config/File.py b/blueman/plugins/config/File.py
index 3beccb4..c17fe77 100644
--- a/blueman/plugins/config/File.py
+++ b/blueman/plugins/config/File.py
@@ -22,7 +22,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):
@@ -77,9 +82,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: