From a8677496d4092f3ee654ff8dfae6378cf99d71bd Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Tue, 23 Apr 2024 12:55:20 +0300 Subject: [PATCH] modules: add waylock --- .../window-manager/hyprland/default.nix | 38 ++++++++++--------- .../nixos/configs/window-manager/hyprland.nix | 6 +++ 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/modules/home-manager/configs/window-manager/hyprland/default.nix b/modules/home-manager/configs/window-manager/hyprland/default.nix index 7b707e0..5138074 100644 --- a/modules/home-manager/configs/window-manager/hyprland/default.nix +++ b/modules/home-manager/configs/window-manager/hyprland/default.nix @@ -114,48 +114,50 @@ in "$fileManager" = "vifm"; "$menu" = "dmenu-wl_run"; - "$mod" = "ALT_L"; + "$m1" = "ALT_L"; + "$m4" = "MOD4"; bind = lib.flatten [ # programs - "$mod SHIFT, Return, exec, $terminal" - "$mod SHIFT, B, exec, $browser" - "$mod, p, exec, $menu" + "$m1 SHIFT, Return, exec, $terminal" + "$m1 SHIFT, B, exec, $browser" + "$m1, p, exec, $menu" # focus (lib.flip lib.mapAttrsToList { k = "prev"; j = "next"; } (k: d: [ - "$mod, ${k}, layoutmsg, cycle${d}" - "$mod SHIFT, ${k}, layoutmsg, swap${d}" + "$m1, ${k}, layoutmsg, cycle${d}" + "$m1 SHIFT, ${k}, layoutmsg, swap${d}" ])) - "$mod, Return, layoutmsg, swapwithmaster, master" - "$mod, s, exec, ${easyfocus}/bin/easyfocus-hyprland" + "$m1, Return, layoutmsg, swapwithmaster, master" + "$m1, s, exec, ${easyfocus}/bin/easyfocus-hyprland" # comma (,) - "$mod, code:44, layoutmsg, addmaster" + "$m1, code:44, layoutmsg, addmaster" # period (.) - "$mod, code:46, layoutmsg, removemaster" + "$m1, code:46, layoutmsg, removemaster" # windows - "MOD4 SHIFT, C, killactive" - "$mod, Space, fullscreen, 0" + "$m4 SHIFT, C, killactive" + "$m1, Space, fullscreen, 0" # workspaces (lib.flip map [ 1 2 3 4 5 6 7 8 9 0 ] (i: let wid = if i == 0 then 10 else i; in [ # switch warkspaces with mod + [0-9] - "$mod, ${toString i}, workspace, ${toString wid}" + "$m1, ${toString i}, workspace, ${toString wid}" # move active window to a workspace with mod + shift + [0-9] - "$mod SHIFT, ${toString i}, movetoworkspacesilent, ${toString wid}" + "$m1 SHIFT, ${toString i}, movetoworkspacesilent, ${toString wid}" ] )) - # syste - "MOD4 SHIFT, Q, exit" + # system + "$m4, L, exec, waylock" + "$m4 SHIFT, Q, exit" ]; bindm = [ - "$mod, mouse:272, movewindow" - "$mod, mouse:273, resizewindow" + "$m1, mouse:272, movewindow" + "$m1, mouse:273, resizewindow" ]; input = let kb = config.home.keyboard; in { diff --git a/modules/nixos/configs/window-manager/hyprland.nix b/modules/nixos/configs/window-manager/hyprland.nix index 53d866c..6bd806a 100644 --- a/modules/nixos/configs/window-manager/hyprland.nix +++ b/modules/nixos/configs/window-manager/hyprland.nix @@ -15,5 +15,11 @@ in }; programs.gnupg.agent.pinentryFlavor = "gtk2"; + + environment.systemPackages = [ pkgs.unstable.waylock ]; + security.pam.services.waylock .text = '' + auth required pam_unix.so try_first_pass nullok + auth optional pam_permit.so + ''; }; }