From ccb081f4f40f71e5db09be082e69af9e25e84e41 Mon Sep 17 00:00:00 2001 From: Justine Smithies Date: Fri, 10 May 2024 19:49:57 +0100 Subject: Updates for using eww as the bar for sway --- .config/eww/scripts/brightnesscontrol | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to '.config/eww/scripts/brightnesscontrol') diff --git a/.config/eww/scripts/brightnesscontrol b/.config/eww/scripts/brightnesscontrol index 1f66f9d..2b51c75 100755 --- a/.config/eww/scripts/brightnesscontrol +++ b/.config/eww/scripts/brightnesscontrol @@ -9,14 +9,15 @@ # https://gist.github.com/sebastiencs/5d7227f388d93374cebdf72e783fbd6a function send_notification { - icon=/usr/share/icons/Papirus-Dark/16x16/actions/brightnesssettings.svg - brightness=$(brightnessctl -P g) + icon=/usr/share/icons/Adwaita/symbolic/status/daytime-sunrise-symbolic.svg + brightness=$(brightnessctl g) + brightness=$((brightness *100 / 255 )) brightness=$(echo "$brightness" | awk '{print ($0-int($0)<0.499)?int($0):int($0)+1}') # Make the bar with the special character ─ (it's not dash -) # https://en.wikipedia.org/wiki/Box-drawing_character bar=$(seq -s "─" 0 $((brightness / 10 )) | sed 's/[0-9]//g') # Send the notification - notify-send -i "$icon" -r 5555 -u normal "$bar $brightness" + notify-send -i "$icon" --hint=string:x-canonical-private-synchronous:brightness -u normal "$bar $brightness" } case $1 in @@ -24,16 +25,17 @@ case $1 in # increase the backlight by 5% brightnessctl s +5% send_notification - canberra-gtk-play -i audio-volume-change + # canberra-gtk-play -i audio-volume-change ;; down) # decrease the backlight by 5% brightnessctl s 5%- send_notification - canberra-gtk-play -i audio-volume-change + # canberra-gtk-play -i audio-volume-change ;; *) - brightness=$(brightnessctl -P g) + brightness=$(brightnessctl g) + brightness=$((brightness *100 / 255 )) brightness=$(echo "$brightness" | awk '{print ($0-int($0)<0.499)?int($0):int($0)+1}') icon="󰃞" printf "%s" "$icon $brightness" "%" -- cgit v1.2.3