setbg updates dwm colorscheme
This commit is contained in:
parent
ae7fa347c2
commit
77af528edf
1 changed files with 4 additions and 3 deletions
|
@ -17,13 +17,12 @@ trueloc="$(readlink -f "$1")" &&
|
||||||
case "$(file --mime-type -b "$trueloc")" in
|
case "$(file --mime-type -b "$trueloc")" in
|
||||||
image/* ) ln -sf "$(readlink -f "$1")" "$bgloc" && notify-send -i "$bgloc" "Changing wallpaper..." ;;
|
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." ;;
|
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
|
esac
|
||||||
|
|
||||||
# If pywal is installed, use it.
|
# If pywal is installed, use it.
|
||||||
if command -v wal >/dev/null 2>&1 ; then
|
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 &&
|
wal -n -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.
|
# If pywal is removed, return config files to normal.
|
||||||
else
|
else
|
||||||
[ -f "$dunstconf.bak" ] && unlink "$dunstconf" && mv "$dunstconf.bak" "$dunstconf"
|
[ -f "$dunstconf.bak" ] && unlink "$dunstconf" && mv "$dunstconf.bak" "$dunstconf"
|
||||||
|
@ -31,3 +30,5 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
xwallpaper --zoom "$bgloc"
|
xwallpaper --zoom "$bgloc"
|
||||||
|
# If running, dwm hit the key to refresh the color scheme.
|
||||||
|
pidof dwm >/dev/null && xdotool key super+F5
|
||||||
|
|
Loading…
Reference in a new issue