From 3f7fb26b8f134ed1d5991f243144f5a20f38aa3c Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 3 Nov 2021 17:49:47 +0100 Subject: [PATCH] home: wm: i3: extract 'notify-send' variable It is used in multiple scripts, might as well centralise it. --- home/wm/i3/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/home/wm/i3/default.nix b/home/wm/i3/default.nix index 8929c6e..38971dc 100644 --- a/home/wm/i3/default.nix +++ b/home/wm/i3/default.nix @@ -26,6 +26,9 @@ let # Generate an attrset of movement bindings, using the mapper function 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 changeBacklight = let @@ -40,7 +43,7 @@ let fi 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 "int:value:''${newBrightness/\%/}" \ -- "Set brightness to $newBrightness" @@ -50,7 +53,6 @@ let toggleXautolock = let systemctlUser = "${pkgs.systemd}/bin/systemctl --user"; - notify-send = "${pkgs.libnotify}/bin/notify-send"; notify = "${notify-send} -u low" + " -h string:x-canonical-private-synchronous:xautolock-toggle"; in