From d5ff12010472ce06212c83a6074017325139ece2 Mon Sep 17 00:00:00 2001 From: ZachIR Date: Sat, 31 May 2025 01:44:46 -0500 Subject: Use bl to brightnessctl def or light --- bl | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'bl') 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" -- cgit v1.2.3