summaryrefslogtreecommitdiffstats
path: root/.local
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2022-07-08 14:25:42 -0400
committerLuke Smith <luke@lukesmith.xyz>2022-07-08 14:25:42 -0400
commit77af528edfd4f225cb7fc4e6c08a6806be85556a (patch)
tree90b6d6e823cd28c3a2ea4e69fbe964e594cb66d4 /.local
parentae7fa347c23e9d5fecf39bdc9cd16662d07fd875 (diff)
downloadeibhear-77af528edfd4f225cb7fc4e6c08a6806be85556a.tar.gz
eibhear-77af528edfd4f225cb7fc4e6c08a6806be85556a.tar.zst
eibhear-77af528edfd4f225cb7fc4e6c08a6806be85556a.zip
setbg updates dwm colorscheme
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/setbg7
1 files changed, 4 insertions, 3 deletions
diff --git a/.local/bin/setbg b/.local/bin/setbg
index 2829896..b72dc7d 100755
--- a/.local/bin/setbg
+++ b/.local/bin/setbg
@@ -17,13 +17,12 @@ trueloc="$(readlink -f "$1")" &&
case "$(file --mime-type -b "$trueloc")" in
image/* ) ln -sf "$(readlink -f "$1")" "$bgloc" && notify-send -i "$bgloc" "Changing wallpaper..." ;;
inode/directory ) ln -sf "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && notify-send -i "$bgloc" "Random Wallpaper chosen." ;;
- *) notify-send "Error" "Not a valid image." ; exit 1;;
+ *) notify-send "🖼️ Error" "Not a valid image or directory." ; exit 1;;
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 -n -i "$(readlink -f $bgloc)" -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1
# If pywal is removed, return config files to normal.
else
[ -f "$dunstconf.bak" ] && unlink "$dunstconf" && mv "$dunstconf.bak" "$dunstconf"
@@ -31,3 +30,5 @@ else
fi
xwallpaper --zoom "$bgloc"
+# If running, dwm hit the key to refresh the color scheme.
+pidof dwm >/dev/null && xdotool key super+F5