workspace/arch-user/config/sway/brightness-set-and-notify.sh
2025-01-05 02:57:00 +00:00

7 lines
303 B
Bash
Executable File

#!/bin/sh
brig="$(brightnessctl set "$1" -m | sed -e 's/.*,\([0-9]*\)%.*/\1/')"
notif_id_file=/dev/shm/workspace-$USER-notify-brig
read -r notif_id < "$notif_id_file"
notify-send -t 2000 -h "int:value:$brig" -a "brightness" "$brig%" \
--replace-id="${notif_id:-99999999}" --print-id > "$notif_id_file"