From 51f9de698d6e26e7f5f645570b9ac8be256baf8c Mon Sep 17 00:00:00 2001 From: paperbenni Date: Thu, 1 Oct 2020 13:07:26 +0200 Subject: [PATCH] restart dunst when changing monitor config --- instantutils.sh | 4 +++- programs/instantdisper | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/instantutils.sh b/instantutils.sh index 6ffbe63..525e81a 100644 --- a/instantutils.sh +++ b/instantutils.sh @@ -41,6 +41,8 @@ open) instantutils default chmod +x ~/.config/instantos/default/"$2" fi - ~/.config/instantos/default/"$2" + APP="$2" + shift 2 + ~/.config/instantos/default/"$APP" "$@" ;; esac diff --git a/programs/instantdisper b/programs/instantdisper index 6d17349..0c30bca 100755 --- a/programs/instantdisper +++ b/programs/instantdisper @@ -24,6 +24,17 @@ defaultmenu() { :b Back' | instantmenu -l 20 -h -1 -w 400 -c -w -1 -bw 4 -q search } +restartdunst() { + sleep 1 + if pgrep dunst + then + echo "restarting dunst" + pkill dunst + sleep 1 + dunst & + fi +} + setdefault() { DEFAULTLOOPING="true" while [ -n "$DEFAULTLOOPING" ]; do @@ -71,6 +82,7 @@ applydefault() { AUTOMON="$(iconf automon)" if grep '^[esSc]$' <<<"$AUTOMON"; then disper -"$AUTOMON" + restartdunst & else echo "none" fi @@ -103,6 +115,7 @@ while [ -n "$LOOPING" ]; do *Extend) echo "extend" disper -e + restartdunst & ;; *only) if grep -q 'PC' <<<"$CHOICE"; then @@ -112,10 +125,12 @@ while [ -n "$LOOPING" ]; do echo "setting display to secondary monitor" disper -S fi + restartdunst & ;; *Duplicate) echo "duplicating monitors" disper -c + restartdunst & ;; *action) echo "setting default action" -- 2.11.0