From 21311806407ac301702996a4658c1dee2bf5f80e Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 16 Aug 2024 22:44:45 +0200 Subject: ... --- overlays/avizo/default.nix | 7 +++++++ overlays/avizo/min-value.patch | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 overlays/avizo/default.nix create mode 100644 overlays/avizo/min-value.patch (limited to 'overlays') diff --git a/overlays/avizo/default.nix b/overlays/avizo/default.nix new file mode 100644 index 00000000..f89f7a8a --- /dev/null +++ b/overlays/avizo/default.nix @@ -0,0 +1,7 @@ +{ prev, ... }: { + avizo = prev.avizo.overrideAttrs (oldAttrs: { + patches = (oldAttrs.patches or []) ++ [ + ./min-value.patch + ]; + }); +} diff --git a/overlays/avizo/min-value.patch b/overlays/avizo/min-value.patch new file mode 100644 index 00000000..629fe3ed --- /dev/null +++ b/overlays/avizo/min-value.patch @@ -0,0 +1,38 @@ +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%\%} + -- cgit v1.2.3