diff --git a/lightctl b/lightctl index f5333ae..6a68aef 100755 --- a/lightctl +++ b/lightctl @@ -16,6 +16,7 @@ # # Options: # -e Change percentage curve to exponential (only for brightnessctl). +# -n Set minimum value (only for brightnessctl). # -D Specify the device name. # -M Set monitor where notification will be shown. # -d Show dark theme friendly variant of the icon @@ -47,13 +48,15 @@ is_float() { } exp= +min= dev= optind=1 dark=0 monitor=-1 -while getopts ':e:D:h:M:d' OPT; do +while getopts ':e:n:D:h:M:d' OPT; do case "$OPT" in e) exp=$OPTARG;; + n) min=$OPTARG;; D) dev=$OPTARG;; h) help; exit 0;; M) monitor="$OPTARG";; @@ -96,7 +99,7 @@ esac if command -v brightnessctl >/dev/null; then prog='brightnessctl' opts="${dev:+-d $dev}" - out=$(brightnessctl $opts ${exp:+-e$exp} -m set "${value}%${cmd}") + out=$(brightnessctl $opts ${exp:+-e$exp} ${min:+-n$min} -m set "${value}%${cmd}") light=$(printf '%s\n' "$out" | cut -d, -f4) light=${light%\%}