about summary refs log tree commit diff stats
path: root/src/theme.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-11-25 21:40:49 +0000
committerJames Booth <boothj5@gmail.com>2012-11-25 21:40:49 +0000
commit4b73f3d7f92e3af6e7ebf3a9551477820024d9d3 (patch)
tree17fdae49e46c5860d993a906ba80fcbc87506a34 /src/theme.c
parent7ea02c718225e1d5701fd686bd2c3718d8327235 (diff)
downloadprofani-tty-4b73f3d7f92e3af6e7ebf3a9551477820024d9d3.tar.gz
Profanity files now use %XDG_CONFIG_HOME and %XDG_DATA_HOME
Diffstat (limited to 'src/theme.c')
-rw-r--r--src/theme.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/theme.c b/src/theme.c
index aafbd859..6274b647 100644
--- a/src/theme.c
+++ b/src/theme.c
@@ -33,6 +33,7 @@
 #include <ncurses/ncurses.h>
 #endif
 
+#include "files.h"
 #include "log.h"
 #include "theme.h"
 
@@ -99,8 +100,10 @@ theme_load(const char * const theme_name)
     theme = g_key_file_new();
 
     if (theme_name != NULL) {
-        theme_loc = g_string_new(getenv("HOME"));
-        g_string_append(theme_loc, "/.profanity/themes/");
+        gchar *themes_dir = files_get_themes_dir();
+        theme_loc = g_string_new(themes_dir);
+        g_free(themes_dir);
+        g_string_append(theme_loc, "/");
         g_string_append(theme_loc, theme_name);
         g_key_file_load_from_file(theme, theme_loc->str, G_KEY_FILE_KEEP_COMMENTS,
             NULL);
@@ -119,8 +122,10 @@ theme_change(const char * const theme_name)
         _load_colours();
         return TRUE;
     } else {
-        GString *new_theme_file = g_string_new(getenv("HOME"));
-        g_string_append(new_theme_file, "/.profanity/themes/");
+        gchar *themes_dir = files_get_themes_dir();
+        GString *new_theme_file = g_string_new(themes_dir);
+        g_free(themes_dir);
+        g_string_append(new_theme_file, "/");
         g_string_append(new_theme_file, theme_name);
 
         // no theme file found