From 2c881f9b64fda7fa5f2b412c58e1316d790546a6 Mon Sep 17 00:00:00 2001 From: thehnm Date: Wed, 1 Jul 2020 12:14:57 +0200 Subject: [PATCH] Use own config home if not set already --- bin/mailsync | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/mailsync b/bin/mailsync index 97e921f..058d2e8 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -15,12 +15,14 @@ command -v notify-send >/dev/null || echo "Note that \`libnotify\` or \`libnotif export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus export DISPLAY=:0.0 +configdir=${XDG_CONFIG_HOME:=$HOME/.config} + # For individual configurations: [ -d "$HOME/.local/share/password-store" ] && export PASSWORD_STORE_DIR="$HOME/.local/share/password-store" if [ -f "$HOME/.config/isync/mbsyncrc" ]; then - MBSYNC="mbsync -c \"$HOME/.config/isync/mbsyncrc\"" - MBSYNCRCPATH="$HOME/.config/isync/mbsyncrc" + MBSYNC="mbsync -c \"$configdir/isync/mbsyncrc\"" + MBSYNCRCPATH="$configdir/isync/mbsyncrc" else MBSYNC="mbsync" MBSYNCRCPATH="$HOME/.mbsyncrc"