From 2ccc926e7af73e3f7af5312b0f548236670fadf4 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Tue, 16 Jul 2024 21:46:57 -0500 Subject: [PATCH] graphical/bars/waybar: call correct locker depending on desktop --- .../graphical/bars/waybar/modules/custom-modules.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/home/programs/graphical/bars/waybar/modules/custom-modules.nix b/modules/home/programs/graphical/bars/waybar/modules/custom-modules.nix index fc861adac..38d4f3ab5 100644 --- a/modules/home/programs/graphical/bars/waybar/modules/custom-modules.nix +++ b/modules/home/programs/graphical/bars/waybar/modules/custom-modules.nix @@ -128,7 +128,8 @@ in menu-actions = let systemctl = getExe' pkgs.systemd "systemctl"; - lock = getExe config.programs.hyprlock.package; + hyprlock = getExe config.programs.hyprlock.package; + swaylock = getExe config.programs.swaylock.package; poweroff = getExe' pkgs.systemd "poweroff"; reboot = getExe' pkgs.systemd "reboot"; terminal = getExe config.programs.kitty.package; @@ -140,7 +141,7 @@ in inherit poweroff reboot; hibernate = "${systemctl} hibernate"; - lock = "${lock} --immediate"; + lock = ''([[ "$XDG_CURRENT_DESKTOP" == "sway" ]] && ${swaylock} -defF) || ([[ "$XDG_CURRENT_DESKTOP" == "Hyprland" ]] && ${hyprlock}} --immediate)''; suspend = "${systemctl} suspend"; top = "${terminal} ${top}"; logout = "$(${hyprctl} dispatch exit || ${swaymsg} exit) && ${systemctl} --user exit ";