summaryrefslogtreecommitdiff
path: root/openbox/session.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-09-15 19:20:05 +0000
committerDana Jansens <danakj@orodu.net>2003-09-15 19:20:05 +0000
commitc1b2fc5324522f74a14a5cfa210c95e1509a6e7f (patch)
tree7024fd9c49d64e29d3f622250199c5d6a382b721 /openbox/session.c
parent3a607fad9df628ab16e0f7436dfbfc9b22634003 (diff)
make openbox base-dir spec compliant, and change the theme dir structure, so that themes go in $XDG_DATA_DIRS/themes/ with gtk/metacity/whateverelse themes
Diffstat (limited to 'openbox/session.c')
-rw-r--r--openbox/session.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/openbox/session.c b/openbox/session.c
index 181dfe8d..9ce04674 100644
--- a/openbox/session.c
+++ b/openbox/session.c
@@ -42,6 +42,7 @@ static gchar *save_file;
static gchar *sm_id;
static gint sm_argc;
static gchar **sm_argv;
+static gchar *sm_sessions_path;
static void session_load(char *path);
static gboolean session_save();
@@ -141,6 +142,10 @@ void session_startup(int *argc, char ***argv)
if (sm_disable)
return;
+ sm_sessions_path = g_build_filename(parse_xdg_data_home_path(),
+ "openbox", "sessions", NULL);
+ parse_mkdir_path(sm_sessions_path, 0700);
+
if (save_file)
session_load(save_file);
@@ -224,6 +229,7 @@ void session_startup(int *argc, char ***argv)
void session_shutdown()
{
+ g_free(sm_sessions_path);
g_free(save_file);
g_free(sm_id);
@@ -298,8 +304,7 @@ static gboolean session_save()
(int) time(NULL),
(int) getpid(),
g_random_int());
- save_file = g_build_filename(g_get_home_dir(), ".openbox", "sessions",
- filename, NULL);
+ save_file = g_build_filename(sm_sessions_path, filename, NULL);
g_free(filename);
f = fopen(save_file, "w");