summaryrefslogtreecommitdiffstats
path: root/.config/wal/postrun
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2021-11-11 12:47:17 -0500
committerLuke Smith <luke@lukesmith.xyz>2021-11-11 12:47:17 -0500
commit11b7fb7b45cdd9af8d3ea3d570986dc03779ba2e (patch)
tree57b069c69fb053ed5c3bdef46817ff569ecaf0fa /.config/wal/postrun
parentab8ab913dab74ba8e94066b495969b01ecc2efd3 (diff)
downloadeibhear-11b7fb7b45cdd9af8d3ea3d570986dc03779ba2e.tar.gz
eibhear-11b7fb7b45cdd9af8d3ea3d570986dc03779ba2e.tar.zst
eibhear-11b7fb7b45cdd9af8d3ea3d570986dc03779ba2e.zip
some dunst and wal fixes, fix #1029
Diffstat (limited to '.config/wal/postrun')
-rwxr-xr-x.config/wal/postrun34
1 files changed, 17 insertions, 17 deletions
diff --git a/.config/wal/postrun b/.config/wal/postrun
index d9a9161..7eb8d11 100755
--- a/.config/wal/postrun
+++ b/.config/wal/postrun
@@ -1,16 +1,17 @@
#!/bin/bash
-dunstconf="${HOME}/.config/dunst/dunstrc"
-zathuraconf="${HOME}/.config/zathura/zathurarc"
+dunstconf="${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc"
+zathuraconf="${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc"
-source "${HOME}/.cache/wal/colors.sh"
+source "${XDG_CACHE_HOME:-$HOME/.cache}/wal/colors.sh"
-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"
+mkdir -p "${dunstconf##*/}" "${zathuraconf##*/}"
+
+mv -n "$dunstconf" "$dunstconf.bak"
+mv -n "$zathuraconf" "$zathuraconf.bak"
+
+ln -sf "${XDG_CACHE_HOME:-$HOME/.cache}/wal/dunstrc" "$dunstconf"
+ln -sf "${XDG_CACHE_HOME:-$HOME/.cache}/wal/zathurarc" "$zathuraconf"
fix_sequences() {
e=$'\e'
@@ -19,14 +20,13 @@ fix_sequences() {
background_color="$(echo -e "${sequences}\c" | grep --color=never -Eo "${e}]11[^${e}\\\\]*?${e}\\\\" | grep --color=never -Eo "#[0-9A-Fa-f]{6}")"
cursor_color="$(echo -e "${sequences}\c" | grep --color=never -Eo "${e}]12[^${e}\\\\]*?${e}\\\\" | grep --color=never -Eo "#[0-9A-Fa-f]{6}")"
-for term in /dev/pts/{0..9}*
-do
-echo -e "\e]4;256;${cursor_color}\a\c" > "${term}" 2>/dev/null
-echo -e "\e]4;258;${background_color}\a\c" > "${term}" 2>/dev/null
-echo -e "\e]4;259;${foreground_color}\a\c" > "${term}" 2>/dev/null
-done
+ for term in /dev/pts/{0..9}*; do
+ echo -e "\e]4;256;${cursor_color}\a\c" > "${term}" 2>/dev/null
+ echo -e "\e]4;258;${background_color}\a\c" > "${term}" 2>/dev/null
+ echo -e "\e]4;259;${foreground_color}\a\c" > "${term}" 2>/dev/null
+ done
}
-fix_sequences <"${HOME}/.cache/wal/sequences"
+fix_sequences <"${XDG_CACHE_HOME:-$HOME/.cache}/wal/sequences"
-pkill dunst; dunst &
+pkill dunst; setsid -f dunst