From 2af0fe542fabee62f55bd1e9ac7134acbf1a98d3 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 4 Nov 2021 15:56:07 +0100 Subject: [PATCH] home: wm: i3: use packaged scripts Instead of inlining them in the configuration, use an actual package for those. --- home/wm/i3/default.nix | 40 ++-------------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) diff --git a/home/wm/i3/default.nix b/home/wm/i3/default.nix index ad2eb36..4465bb0 100644 --- a/home/wm/i3/default.nix +++ b/home/wm/i3/default.nix @@ -30,46 +30,10 @@ let notify-send = "${pkgs.libnotify}/bin/notify-send"; # Screen backlight management - changeBacklight = - let - brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl"; - in - pkgs.writeScript "change-backlight" '' - #!/bin/sh - if [ "$1" = "up" ]; then - upDown="+$2%" - else - upDown="$2%-" - fi - - newBrightness="$(${brightnessctl} -m set "$upDown" | cut -d, -f4)" - ${notify-send} -u low \ - -h string:x-canonical-private-synchronous:change-backlight \ - -h "int:value:''${newBrightness/\%/}" \ - -- "Set brightness to $newBrightness" - ''; + changeBacklight = "${pkgs.ambroisie.change-backlight}/bin/change-backlight"; # Audio and volume management - changeAudio = - let - pamixer = "${pkgs.pamixer}/bin/pamixer"; - in - pkgs.writeScript "change-audio" '' - #!/bin/sh - if [ "$1" = "up" ]; then - upDown="-i" - else - upDown="-d" - fi - - ${pamixer} --allow-boost "$upDown" "$2" - newVolume="$(${pamixer} --get-volume)" - - ${notify-send} -u low \ - -h string:x-canonical-private-synchronous:change-audio \ - -h "int:value:$newVolume" \ - -- "Set volume to $newVolume " - ''; + changeAudio = "${pkgs.ambroisie.change-audio}/bin/change-audio"; # Lock management toggleXautolock =