From e01d89966642302289f2b6ba86e1b7caea678edd Mon Sep 17 00:00:00 2001 From: John Mertz Date: Thu, 1 Feb 2024 20:28:50 -0700 Subject: [PATCH] Fix notification when /tmp/brightness-notification does not exist or is empty --- waybar/waybar-backlight.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/waybar/waybar-backlight.sh b/waybar/waybar-backlight.sh index a3aea60..8b7c83f 100755 --- a/waybar/waybar-backlight.sh +++ b/waybar/waybar-backlight.sh @@ -41,10 +41,10 @@ else fi fi -if [ -n $NOTIFY_ID ]; then - NOTIFY_ID=$(notify-send --category=backlight --urgency=low --hint=int:value:$BRIGHTNESS --icon=${HOME}/.icons/Gruvbox/48x48@2x/status/notification-display-brightness${ICON}.svg -p -t 1000 -r $NOTIFY_ID Backlight ${BRIGHTNESS}%) -else +if [ -z $NOTIFY_ID ]; then NOTIFY_ID=$(notify-send --category=backlight --urgency=low --hint=int:value:$BRIGHTNESS --icon=${HOME}/.icons/Gruvbox/48x48@2x/devices/notification-display-brightness${ICON}.svg -p -t 1000 Backlight ${BRIGHTNESS}%) +else + NOTIFY_ID=$(notify-send --category=backlight --urgency=low --hint=int:value:$BRIGHTNESS --icon=${HOME}/.icons/Gruvbox/48x48@2x/status/notification-display-brightness${ICON}.svg -p -t 1000 -r $NOTIFY_ID Backlight ${BRIGHTNESS}%) fi echo $NOTIFY_ID > /tmp/brightness-notification