aboutsummaryrefslogtreecommitdiff
path: root/.config/qtile
diff options
context:
space:
mode:
authorJustine Smithies <justine@smithies.me.uk>2023-09-24 15:12:50 +0100
committerJustine Smithies <justine@smithies.me.uk>2023-09-24 15:12:50 +0100
commitcf4a4046fe7a80682c37ce645f6d1766a20e15f5 (patch)
treed03717b94243eaa05e89fd16755220bbc5c39937 /.config/qtile
parent04c8324c5f5e39eb02b1ccdca8d3d24035f9057a (diff)
Switched from Light to Brightnessctl
Diffstat (limited to '.config/qtile')
-rwxr-xr-x.config/qtile/statusbar/brightnesscontrol12
1 files changed, 7 insertions, 5 deletions
diff --git a/.config/qtile/statusbar/brightnesscontrol b/.config/qtile/statusbar/brightnesscontrol
index 304c187..29bbd83 100755
--- a/.config/qtile/statusbar/brightnesscontrol
+++ b/.config/qtile/statusbar/brightnesscontrol
@@ -10,12 +10,13 @@
function send_notification {
icon=/usr/share/icons/Papirus-Dark/16x16/actions/brightnesssettings.svg
- brightness=$(light -G)
+ 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')
- #brightness=$((brightness *100 / 255 ))
+ # brightness=$((brightness *100 / 255 ))
#echo $bar
#echo $test
# Send the notification
@@ -25,18 +26,19 @@ function send_notification {
case $1 in
up)
# increase the backlight by 5%
- light -A 5
+ brightnessctl s +5
send_notification
canberra-gtk-play -i audio-volume-change
;;
down)
# decrease the backlight by 5%
- light -U 5
+ brightnessctl s 5-
send_notification
canberra-gtk-play -i audio-volume-change
;;
*)
- brightness=$(light -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" "%"