summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2021-10-20 10:33:08 -0400
committerLuke Smith <luke@lukesmith.xyz>2021-10-20 10:33:08 -0400
commite9b40ba5546459bbe14176299052abcd4ce4d0ba (patch)
tree3c654798ddc4983594693f211cb575cb29f8ad67
parent714aa92a9596352d4f70e35d212fe922c23348b4 (diff)
parentcb7879cd7ecc7d226bcb3f00c6cc0e343f03bff7 (diff)
downloadeibhear-e9b40ba5546459bbe14176299052abcd4ce4d0ba.tar.gz
eibhear-e9b40ba5546459bbe14176299052abcd4ce4d0ba.tar.zst
eibhear-e9b40ba5546459bbe14176299052abcd4ce4d0ba.zip
Merge branch 'krisdoodle45-patch-6'
-rwxr-xr-x.config/wal/postrun15
-rwxr-xr-x.local/bin/setbg12
2 files changed, 17 insertions, 10 deletions
diff --git a/.config/wal/postrun b/.config/wal/postrun
index 85d9e3f..d9a9161 100755
--- a/.config/wal/postrun
+++ b/.config/wal/postrun
@@ -1,13 +1,16 @@
#!/bin/bash
+dunstconf="${HOME}/.config/dunst/dunstrc"
+zathuraconf="${HOME}/.config/zathura/zathurarc"
+
source "${HOME}/.cache/wal/colors.sh"
-mkdir -p "${HOME}/.config/dunst"
-mkdir -p "${HOME}/.config/zathura"
-mv -n "${HOME}/.config/dunst/dunstrc" "${HOME}/.config/dunst/dunstrc.bak"
-mv -n "${HOME}/.config/zathura/zathurarc" "${HOME}/.config/zathura/zathurarc.bak"
-ln -sf "${HOME}/.cache/wal/dunstrc" "${HOME}/.config/dunst/dunstrc"
-ln -sf "${HOME}/.cache/wal/zathurarc" "${HOME}/.config/zathura/zathurarc"
+mkdir -p "$dunstconf"
+mkdir -p "$zathuraconf"
+mv -n "$dunstconf" "$dunstconf.bak"
+mv -n "$zathuraconf" "$zathuraconf.bak"
+ln -sf "${HOME}/.cache/wal/dunstrc" "$dunstconf"
+ln -sf "${HOME}/.cache/wal/zathurarc" "$zathuraconf"
fix_sequences() {
e=$'\e'
diff --git a/.local/bin/setbg b/.local/bin/setbg
index 7f997b7..b0938fd 100755
--- a/.local/bin/setbg
+++ b/.local/bin/setbg
@@ -9,6 +9,10 @@
# Location of link to wallpaper link.
bgloc="${XDG_DATA_HOME:-$HOME/.local/share/}/bg"
+# Configuration files of applications that have their themes changed by pywal.
+dunstconf="${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc"
+zathuraconf="${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc"
+
trueloc="$(readlink -f "$1")" &&
case "$(file --mime-type -b "$trueloc")" in
image/* ) ln -sf "$(readlink -f "$1")" "$bgloc" && notify-send -i "$bgloc" "Changing wallpaper..." ;;
@@ -18,12 +22,12 @@ esac
# If pywal is installed, use it.
if command -v wal >/dev/null 2>&1 ; then
- wal -i "$(readlink -f $bgloc)" -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1 &&
- pidof dwm >/dev/null && xdotool key super+F12
+ wal -i "$(readlink -f $bgloc)" -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1 &&
+ pidof dwm >/dev/null && xdotool key super+F12
# If pywal is removed, return config files to normal.
else
- [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc.bak" ] && unlink "${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc" && mv "${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc.bak" "${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc"
- [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc.bak" ] && unlink "${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc" && mv "${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc.bak" "${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc"
+ [ -f "$dunstconf.bak" ] && unlink "$dunstconf" && mv "$dunstconf.bak" "$dunstconf"
+ [ -f "$zathuraconf.bak" ] && unlink "$zathuraconf" && mv "$zathuraconf.bak" "$zathuraconf"
fi
xwallpaper --zoom "$bgloc"