home: wm: i3: extract 'notify-send' variable

It is used in multiple scripts, might as well centralise it.
This commit is contained in:
Bruno BELANYI 2021-11-03 17:49:47 +01:00
parent 450ab4b07b
commit 335454ee16

View file

@ -26,6 +26,9 @@ let
# Generate an attrset of movement bindings, using the mapper function # Generate an attrset of movement bindings, using the mapper function
genMovementBindings = f: addVimKeyBindings (lib.my.genAttrs' movementKeys f); genMovementBindings = f: addVimKeyBindings (lib.my.genAttrs' movementKeys f);
# Used in multiple scripts to show messages through keybindings
notify-send = "${pkgs.libnotify}/bin/notify-send";
# Screen backlight management # Screen backlight management
changeBacklight = changeBacklight =
let let
@ -40,7 +43,7 @@ let
fi fi
newBrightness="$(${brightnessctl} -m set "$upDown" | cut -d, -f4)" newBrightness="$(${brightnessctl} -m set "$upDown" | cut -d, -f4)"
${pkgs.libnotify}/bin/notify-send -u low \ ${notify-send} -u low \
-h string:x-canonical-private-synchronous:change-backlight \ -h string:x-canonical-private-synchronous:change-backlight \
-h "int:value:''${newBrightness/\%/}" \ -h "int:value:''${newBrightness/\%/}" \
-- "Set brightness to $newBrightness" -- "Set brightness to $newBrightness"
@ -50,7 +53,6 @@ let
toggleXautolock = toggleXautolock =
let let
systemctlUser = "${pkgs.systemd}/bin/systemctl --user"; systemctlUser = "${pkgs.systemd}/bin/systemctl --user";
notify-send = "${pkgs.libnotify}/bin/notify-send";
notify = "${notify-send} -u low" notify = "${notify-send} -u low"
+ " -h string:x-canonical-private-synchronous:xautolock-toggle"; + " -h string:x-canonical-private-synchronous:xautolock-toggle";
in in