From 6f5c76b462467e96cabc09cd243da4eabcecf4cd Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Tue, 14 Nov 2023 21:53:22 +0100 Subject: [PATCH] Drop mako support --- arch/stow/_scripts/.scripts/dnd.sh | 22 ---------------------- scripts/do-not-disturb.sh | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 22 deletions(-) delete mode 100755 arch/stow/_scripts/.scripts/dnd.sh create mode 100755 scripts/do-not-disturb.sh diff --git a/arch/stow/_scripts/.scripts/dnd.sh b/arch/stow/_scripts/.scripts/dnd.sh deleted file mode 100755 index 5037511..0000000 --- a/arch/stow/_scripts/.scripts/dnd.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash -# Script to toggle Do not disturb mode for mako and dunst - -# Permanent memory -saved_state=0 - -# Toggle -if [[ ${saved_state} -eq 0 ]] ; then - ~/.scripts/notify.sh 'Hiding notifications' - sleep 5 - makoctl set-mode do-not-disturb - dunstctl set-paused true -else - makoctl set-mode default - dunstctl set-paused false - ~/.scripts/notify.sh 'Showing notifications' -fi - -# Update status in file -new_state=$(( (${saved_state} + 1) % 2 )) -sed -i "s/^saved_state=.*$/saved_state=${new_state}/" "${0}" - diff --git a/scripts/do-not-disturb.sh b/scripts/do-not-disturb.sh new file mode 100755 index 0000000..c9c5f21 --- /dev/null +++ b/scripts/do-not-disturb.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# Script to toggle Do not disturb mode for dunst + +# Get current state +if [ "$( command -v dunstctl )" ]; then + current_state="$( dunstctl is-paused )" +fi + +# Toggle +if [ "${current_state}" == "false" ] ; then + notify-send 'Hiding notifications' + sleep 5 + # makoctl set-mode do-not-disturb + dunstctl set-paused true +else + # makoctl set-mode default + dunstctl set-paused false + notify-send 'Showing notifications' +fi