aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2024-04-09 08:18:28 +0200
committerPatrick Spek <p.spek@tyil.nl>2024-04-09 08:18:28 +0200
commit62e9fb4aab172344d33231a39b39a09c80b7efc3 (patch)
tree88ce4b7afa62c9bc9d6561063bddebe04f2d54e5
parent3c9c6a6cd4284dbf10618bc82a0f13ad2e75d76f (diff)
Make bl script never go under 1 brightness
-rwxr-xr-x.local/bin/bl8
1 files changed, 7 insertions, 1 deletions
diff --git a/.local/bin/bl b/.local/bin/bl
index 3f192c9..ee71504 100755
--- a/.local/bin/bl
+++ b/.local/bin/bl
@@ -33,7 +33,13 @@ main()
notify="Brightness increased to $(brightness_level)%"
;;
dec)
- brightnessctl set ${2:-5}%-
+ if [ $(brightness_level) -lt $(( ${2:-5} + 1 )) ]
+ then
+ brightnessctl set 1
+ else
+ brightnessctl set ${2:-5}%-
+ fi
+
notify="Brightness lowered to $(brightness_level)%"
;;
set)