From 21311806407ac301702996a4658c1dee2bf5f80e Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 16 Aug 2024 22:44:45 +0200 Subject: ... --- accounts/gkleen@sif/default.nix | 4 ++-- accounts/gkleen@sif/hyprland.nix | 4 ++-- overlays/avizo/default.nix | 7 +++++++ overlays/avizo/min-value.patch | 38 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 overlays/avizo/default.nix create mode 100644 overlays/avizo/min-value.patch diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index 4913b244..47d2212b 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix @@ -427,8 +427,8 @@ in { icon-size = iconSize; tooltip-format = "{percent}%"; format-icons = ["󰃚" "󰃛" "󰃜" "󰃝" "󰃞" "󰃟" "󰃠"]; - on-scroll-up = "lightctl -d up"; - on-scroll-down = "lightctl -d down"; + on-scroll-up = "lightctl -d -e4 -n1 up"; + on-scroll-down = "lightctl -d -e4 -n1 down"; }; wireplumber = { format = "{icon}"; diff --git a/accounts/gkleen@sif/hyprland.nix b/accounts/gkleen@sif/hyprland.nix index 0c7f19cb..23cbc972 100644 --- a/accounts/gkleen@sif/hyprland.nix +++ b/accounts/gkleen@sif/hyprland.nix @@ -178,8 +178,8 @@ in { "$mainMod ALT, E, exec, emacsclient -c" - ", XF86MonBrightnessUp, exec, lightctl -d up" - ", XF86MonBrightnessDown, exec, lightctl -d down" + ", XF86MonBrightnessUp, exec, lightctl -d -e4 -n1 up" + ", XF86MonBrightnessDown, exec, lightctl -d -e4 -n1 down" ", XF86AudioRaiseVolume, exec, volumectl -d -u up" ", XF86AudioLowerVolume, exec, volumectl -d -u down" ", XF86AudioMute, exec, volumectl -d toggle-mute" 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