summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2014-05-22 15:58:27 +0200
committerDaniel Friesel <derf@finalrewind.org>2014-05-22 15:58:27 +0200
commit28053de1b28721e39a74e2190d75183c700acdc9 (patch)
treec1144f66f5c1b93421fef9a31a50ac94553ed023 /src
parentbc13f70153cdad3e836a3c55d2a80fc85956d5d5 (diff)
do not depend on HOME being set
this introduces a bug in feh_wm_set_bg, which will be fixed in the next commit (only applies when run without HOME)
Diffstat (limited to 'src')
-rw-r--r--src/events.c7
-rw-r--r--src/keyevents.c7
-rw-r--r--src/options.c13
3 files changed, 13 insertions, 14 deletions
diff --git a/src/events.c b/src/events.c
index e6cf0ac..76c3e64 100644
--- a/src/events.c
+++ b/src/events.c
@@ -110,15 +110,14 @@ void init_buttonbindings(void)
feh_set_bb(&buttons.rotate, 4, 2);
home = getenv("HOME");
- if (!home)
- eprintf("No HOME in environment");
-
confhome = getenv("XDG_CONFIG_HOME");
if (confhome)
confpath = estrjoin("/", confhome, "feh/buttons", NULL);
- else
+ else if (home)
confpath = estrjoin("/", home, ".config/feh/buttons", NULL);
+ else
+ return;
conf = fopen(confpath, "r");
diff --git a/src/keyevents.c b/src/keyevents.c
index 97acb3e..83fc358 100644
--- a/src/keyevents.c
+++ b/src/keyevents.c
@@ -157,15 +157,14 @@ void init_keyevents(void) {
feh_set_kb(&keys.toggle_keep_vp, 0, XK_k, 0, 0, 0, 0);
home = getenv("HOME");
- if (!home)
- eprintf("No HOME in environment");
-
confhome = getenv("XDG_CONFIG_HOME");
if (confhome)
confpath = estrjoin("/", confhome, "feh/keys", NULL);
- else
+ else if (home)
confpath = estrjoin("/", home, ".config/feh/keys", NULL);
+ else
+ return;
conf = fopen(confpath, "r");
diff --git a/src/options.c b/src/options.c
index 7542cd5..8fbdbfb 100644
--- a/src/options.c
+++ b/src/options.c
@@ -132,15 +132,16 @@ static void feh_load_options_for_theme(char *theme)
int cont = 0;
int bspos;
- if (!home)
- eprintf("You have no HOME, cannot read themes");
-
- oldrcpath = estrjoin("/", home, ".fehrc", NULL);
-
if (confbase)
rcpath = estrjoin("/", confbase, "feh/themes", NULL);
- else
+ else if (home)
rcpath = estrjoin("/", home, ".config/feh/themes", NULL);
+ else {
+ weprintf("You have no HOME, cannot read configuration");
+ return;
+ }
+
+ oldrcpath = estrjoin("/", home, ".fehrc", NULL);
fp = fopen(rcpath, "r");