summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachIR <zachir@librem.one>2025-05-31 01:44:46 -0500
committerZachIR <zachir@librem.one>2025-05-31 01:44:46 -0500
commitd5ff12010472ce06212c83a6074017325139ece2 (patch)
treea23b1fece4b1716da8240d7767638543b41e8cef
parent6bc13a61e63b5d0c049bd194f6d365f2f09d709c (diff)
Use bl to brightnessctl def or lightHEADmaster
-rwxr-xr-xbl22
1 files changed, 11 insertions, 11 deletions
diff --git a/bl b/bl
index 43e2125..6da84ec 100755
--- a/bl
+++ b/bl
@@ -17,21 +17,21 @@ printhelp () {
printf "\t-s) X\tsets the backlight to X percent\n"
printf "\t-g) \tgets the backlight\n"
printf "\t-h) \tprints this help message.\n"
- printf "\t-x) \tuse xbacklight instead of light.\n"
- printf "\t-X) \tdon't use xbacklight instead of light.\n"
+ printf "\t-x) \tuse light instead of brightnessctl.\n"
+ printf "\t-X) \tdon't use light instead of brightnessctl.\n"
}
#}}}
#{{{ defaults
-CMD="light"
+CMD="brightnessctl"
ARG="get"
AMT="1"
#}}}
#{{{ getopts2
while getopts "hxXidgI:D:s:" o; do case "${o}" in
- x) CMD="xbacklight" ;;
- X) CMD="light" ;;
+ x) CMD="light" ;;
+ X) CMD="brightnessctl" ;;
i) ARG="inc" ;;
d) ARG="dec" ;;
g) ARG="get" ;;
@@ -53,23 +53,23 @@ esac done
#{{{ main
case "$CMD" in
- "light")
+ "brightnessctl")
case "$ARG" in
"inc")
- light -A "$AMT%"
+ brightnessctl -s set "+$AMT%"
;;
"dec")
- light -U "$AMT%"
+ brightnessctl -s set "$AMT%-"
;;
"set")
- light -S "$AMT%"
+ brightnessctl -s set "$AMT%"
;;
"get")
- light -G
+ brightnessctl | cut -d' ' -f3 | paste -s -d' ' | awk '{printf "%5.2f\n", 100 * $2 / $3}'
;;
esac
;;
- "xbacklight")
+ "light")
case "$ARG" in
"inc")
light -A "$AMT"