]> git.lizzy.rs Git - bspwm.git/commitdiff
Use the default is XDG_CONFIG_HOME is not set
authorBastien Dejean <nihilhill@gmail.com>
Thu, 28 Feb 2013 10:22:50 +0000 (11:22 +0100)
committerBastien Dejean <nihilhill@gmail.com>
Thu, 28 Feb 2013 10:22:50 +0000 (11:22 +0100)
settings.c
settings.h

index f222a79df81f1ecac34bc4bd485bb4b50ec8dc75..756dfe56e07791b500f1463dbf960a610bbc78e3 100644 (file)
@@ -14,7 +14,11 @@ void run_autostart(void)
 {
     char path[MAXLEN];
 
-    snprintf(path, sizeof(path), "%s/%s/%s", getenv("XDG_CONFIG_HOME"), WM_NAME, AUTOSTART_FILE);
+    char *config_home = getenv(CONFIG_HOME_ENV);
+    if (config_home != NULL)
+        snprintf(path, sizeof(path), "%s/%s/%s", config_home, WM_NAME, AUTOSTART_FILE);
+    else
+        snprintf(path, sizeof(path), "%s/%s/%s/%s", getenv("HOME"), ".config", WM_NAME, AUTOSTART_FILE);
 
     if (fork() == 0) {
         if (dpy != NULL)
index 9525c35281742f3b6d89bcde8532f1f0d4efa599..2970cc3e1c6d9729f3e838ef814e8bbb246d0506 100644 (file)
@@ -5,6 +5,7 @@
 
 #define WM_NAME             "bspwm"
 #define AUTOSTART_FILE      "autostart"
+#define CONFIG_HOME_ENV     "XDG_CONFIG_HOME"
 
 #define FOCUSED_BORDER_COLOR        "#7E7F89"
 #define ACTIVE_BORDER_COLOR         "#545350"