Fix notification when /tmp/brightness-notification does not exist or is empty

This commit is contained in:
John Mertz 2024-02-01 20:28:50 -07:00
parent 74af6090d1
commit e01d899666
1 changed files with 3 additions and 3 deletions

View File

@ -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