From c8bdda59bb0a40c0815182a528d184846800c657 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Sat, 19 Dec 2020 11:48:55 +0100 Subject: [PATCH] appointments only in statusbar if notifs allowed --- .local/bin/statusbar/appointments | 5 ++++- .local/bin/statusbar/dunststatus | 11 +++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.local/bin/statusbar/appointments b/.local/bin/statusbar/appointments index 544c92f..f56530c 100755 --- a/.local/bin/statusbar/appointments +++ b/.local/bin/statusbar/appointments @@ -12,7 +12,10 @@ if [ -n "$diff" ]; then else midnight=$(( $(date --date "$(date | sed 's/..:..:../23:59:59/; s/ PM//; s/ AM//')" +%s) + 1 )) if [ $midnight -gt "$time_appointment" ]; then - printf '%s %s' "$(date --date "@$time_appointment" +'%H:%M')" "$appointment" + if [ ! -f /tmp/nodunst ]; then + printf '%s %s' "$(date --date "@$time_appointment" +'%H:%M')" "$appointment" + fi + printf '\n' fi fi else diff --git a/.local/bin/statusbar/dunststatus b/.local/bin/statusbar/dunststatus index f2cb2f5..f666672 100755 --- a/.local/bin/statusbar/dunststatus +++ b/.local/bin/statusbar/dunststatus @@ -1,5 +1,12 @@ #!/bin/sh +APPOINTMENTS_SIGNAL=8 if [ "$( dunstctl is-paused )" = "true" ]; then - printf '🔕' + printf '🔕\n' + if [ ! -f /tmp/nodunst ]; then + touch /tmp/nodunst + fi +else + printf '\n' + rm -f /tmp/nodunst fi -printf '\n' +pkill -RTMIN+$APPOINTMENTS_SIGNAL dwmblocks #update appointments after file has been created/deleted