set up a default rc file, and change teh user rc to ~./openbox/epistrc

This commit is contained in:
Dana Jansens 2002-08-16 03:28:20 +00:00
parent 13cf497f83
commit 544da8c704
2 changed files with 26 additions and 2 deletions

View file

@ -1,6 +1,8 @@
# util/epist/Makefile.am for Blackbox - an X11 Window manager # util/epist/Makefile.am for Blackbox - an X11 Window manager
CPPFLAGS= @CPPFLAGS@ @DEBUG@ DEFAULT_RC=$(pkgdatadir)/epistrc
CPPFLAGS= @CPPFLAGS@ @DEBUG@ -DDEFAULTRC=\"$(DEFAULT_RC)\"
#EXTRA_PROGRAMS = epist #EXTRA_PROGRAMS = epist
bin_PROGRAMS = epist bin_PROGRAMS = epist
@ -17,6 +19,13 @@ MAINTAINERCLEANFILES = Makefile.in
distclean-local: distclean-local:
rm -f *\~ .\#* rm -f *\~ .\#*
install-data-local: epistrc
test -f $(DESTDIR)$(pkgdatadir)/epistrc || \
$(INSTALL_DATA) epistrc $(DESTDIR)$(pkgdatadir)
uninstall-am:
rm -f $(DESTDIR)$(pkgdatadir)/epistrc
# local dependencies # local dependencies
actions.o: actions.cc actions.hh actions.o: actions.cc actions.hh

View file

@ -41,6 +41,16 @@ extern "C" {
#ifdef HAVE_LIBGEN_H #ifdef HAVE_LIBGEN_H
# include <libgen.h> # include <libgen.h>
#endif // HAVE_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> #include <iostream>
@ -66,7 +76,12 @@ epist::epist(char **argv, char *dpy_name, char *rc_file)
if (rc_file) if (rc_file)
_rc_file = rc_file; _rc_file = rc_file;
else 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()); _xatom = new XAtom(getXDisplay());