[Abcde-users] Proposed patch to support XDG_CONFIG_HOME

Romain Failliot romain.failliot at foolstep.com
Wed Sep 23 23:39:29 BST 2020


Hello!

I think it would be nice if abcde could fetch its config file from
~/.config/ so I made a patch.

I don't know how it works for abcde (I am more used to MR in gitlab or
PR in github), so I'll join both the patch text and file:

diff --git a/abcde b/abcde
index 7ea1f94..308f3fd 100755
--- a/abcde
+++ b/abcde
@@ -4082,8 +4082,13 @@ fi
 if [ -r /etc/abcde.conf ]; then
     . /etc/abcde.conf
 fi
+
 # Load user preference defaults
-if [ -r "$HOME/.abcde.conf" ]; then
+if [ -n "$XDG_CONFIG_HOME" -a -r "$XDG_CONFIG_HOME/abcde.conf" ]; then
+    . "$XDG_CONFIG_HOME/abcde.conf"
+elif [ -r "$HOME/.config/abcde.conf" ]; then
+    . "$HOME/.config/abcde.conf"
+elif [ -r "$HOME/.abcde.conf" ]; then
     . "$HOME/.abcde.conf"
 fi

Thank you!
Romain
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xdg-config-home.patch
Type: text/x-patch
Size: 494 bytes
Desc: not available
URL: <http://lists.einval.com/pipermail/abcde-users/attachments/20200923/8d5b1e26/attachment.bin>


More information about the Abcde-users mailing list