diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2024-08-16 22:44:45 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2024-08-16 22:44:45 +0200 |
commit | 21311806407ac301702996a4658c1dee2bf5f80e (patch) | |
tree | bd00318d641bcf83c341351f50f6b8869f3ad4b2 /overlays/avizo | |
parent | 12793fd839de4353df35690faaadbdf9c43f29f6 (diff) | |
download | nixos-21311806407ac301702996a4658c1dee2bf5f80e.tar nixos-21311806407ac301702996a4658c1dee2bf5f80e.tar.gz nixos-21311806407ac301702996a4658c1dee2bf5f80e.tar.bz2 nixos-21311806407ac301702996a4658c1dee2bf5f80e.tar.xz nixos-21311806407ac301702996a4658c1dee2bf5f80e.zip |
...
Diffstat (limited to 'overlays/avizo')
-rw-r--r-- | overlays/avizo/default.nix | 7 | ||||
-rw-r--r-- | overlays/avizo/min-value.patch | 38 |
2 files changed, 45 insertions, 0 deletions
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 @@ | |||
1 | { prev, ... }: { | ||
2 | avizo = prev.avizo.overrideAttrs (oldAttrs: { | ||
3 | patches = (oldAttrs.patches or []) ++ [ | ||
4 | ./min-value.patch | ||
5 | ]; | ||
6 | }); | ||
7 | } | ||
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 @@ | |||
1 | diff --git a/lightctl b/lightctl | ||
2 | index f5333ae..6a68aef 100755 | ||
3 | --- a/lightctl | ||
4 | +++ b/lightctl | ||
5 | @@ -16,6 +16,7 @@ | ||
6 | # | ||
7 | # Options: | ||
8 | # -e <exponent> Change percentage curve to exponential (only for brightnessctl). | ||
9 | +# -n <min_value> Set minimum value (only for brightnessctl). | ||
10 | # -D <device> Specify the device name. | ||
11 | # -M <monitornr> Set monitor where notification will be shown. | ||
12 | # -d Show dark theme friendly variant of the icon | ||
13 | @@ -47,13 +48,15 @@ is_float() { | ||
14 | } | ||
15 | |||
16 | exp= | ||
17 | +min= | ||
18 | dev= | ||
19 | optind=1 | ||
20 | dark=0 | ||
21 | monitor=-1 | ||
22 | -while getopts ':e:D:h:M:d' OPT; do | ||
23 | +while getopts ':e:n:D:h:M:d' OPT; do | ||
24 | case "$OPT" in | ||
25 | e) exp=$OPTARG;; | ||
26 | + n) min=$OPTARG;; | ||
27 | D) dev=$OPTARG;; | ||
28 | h) help; exit 0;; | ||
29 | M) monitor="$OPTARG";; | ||
30 | @@ -96,7 +99,7 @@ esac | ||
31 | if command -v brightnessctl >/dev/null; then | ||
32 | prog='brightnessctl' | ||
33 | opts="${dev:+-d $dev}" | ||
34 | - out=$(brightnessctl $opts ${exp:+-e$exp} -m set "${value}%${cmd}") | ||
35 | + out=$(brightnessctl $opts ${exp:+-e$exp} ${min:+-n$min} -m set "${value}%${cmd}") | ||
36 | light=$(printf '%s\n' "$out" | cut -d, -f4) | ||
37 | light=${light%\%} | ||
38 | |||