[STUMP] [PATCH] Add ~/.stumpwm.d/config as an init-file option

Edward Trumbo <[email protected]>
Newsgroups gmane.comp.window-managers.stumpwm.devel
Message-ID <[email protected]>
It seems to me now that we have a commonly used $HOME/.stumpwm.d
directory, we could be using it for our init file(s) as well.

stumpwm.lisp starts out with the not-well-publicized "load-rc-file"
function, which currently gives us three options for placing and
locating StumpWM's init: an XDG-style $HOME/config/stumpwm/config, the
$HOME/.stumpwmrc we're all familiar with, and a system-wide
/etc/stumpwmrc. The obvious option is being overlooked.

Maybe I just like my $HOME to be as neat as I can make it, or I like to
keep related things all in the same place. Anyway, I've just applied
this trivial patch and it's working for me. To the options listed above,
it adds a "dir-rc" pointing to $HOME/.stumpwm.d/config.

---
 stumpwm.lisp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/stumpwm.lisp b/stumpwm.lisp
index 0a38fef..323d76a 100644
--- a/stumpwm.lisp
+++ b/stumpwm.lisp
@@ -43,10 +43,12 @@ further up. "
                  dir)))
          (user-rc
            (probe-file (merge-pathnames #p".stumpwmrc" (user-homedir-pathname))))
+         (dir-rc
+           (probe-file (merge-pathnames #p".stumpwm.d/config" (user-homedir-pathname))))
          (conf-rc
            (probe-file (merge-pathnames #p"stumpwm/config" xdg-config-dir)))
          (etc-rc (probe-file #p"/etc/stumpwmrc"))
-         (rc (or user-rc conf-rc etc-rc)))
+         (rc (or user-rc dir-rc conf-rc etc-rc)))
     (if rc
         (if catch-errors
             (handler-case (load rc)
-- 
1.8.4


-- 
Edward Trumbo

"In Emacs Veritas."
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.