]> Dogcows Code - chaz/openbox/blobdiff - util/epist/epist.cc
set up a default rc file, and change teh user rc to ~./openbox/epistrc
[chaz/openbox] / util / epist / epist.cc
index a0b1666a2dfd70cb13a2c402eda6727095bae652..a5b829b0063bb29133aa9ceea8df067831aa2455 100644 (file)
@@ -41,6 +41,16 @@ extern "C" {
 #ifdef    HAVE_LIBGEN_H
 #  include <libgen.h>
 #endif // HAVE_LIBGEN_H
+
+#ifdef    HAVE_UNISTD_H
+#  include <sys/types.h>
+#  include <unistd.h>
+#endif // HAVE_UNISTD_H
+
+#ifdef    HAVE_SYS_STAT_H
+#  include <sys/types.h>
+#  include <sys/stat.h>
+#endif // HAVE_SYS_STAT_H
 }
 
 #include <iostream>
@@ -66,7 +76,12 @@ epist::epist(char **argv, char *dpy_name, char *rc_file)
   if (rc_file)
     _rc_file = rc_file;
   else
-    _rc_file = expandTilde("~/.epistrc");
+    _rc_file = expandTilde("~/.openbox/epistrc");
+
+  struct stat buf;
+  if (0 != stat(_rc_file.c_str(), &buf) ||
+      !S_ISREG(buf.st_mode))
+    _rc_file = DEFAULTRC;
 
   _xatom = new XAtom(getXDisplay());
 
This page took 0.026406 seconds and 4 git commands to generate.