From a08e2e7ece8f0b66e9e2b4bb8d2d37a3c8bf2ef1 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Fri, 29 Mar 2024 23:27:08 -0400 Subject: [PATCH] hyprland: added wlogout --- .../desktopEnv/hypr/default.nix | 1 + .../desktopEnv/hypr/hyprland.conf | 4 ++- homeManagerModules/guiApps/default.nix | 1 + .../guiApps/wlogout/default.nix | 30 +++++++++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 homeManagerModules/guiApps/wlogout/default.nix diff --git a/homeManagerModules/desktopEnv/hypr/default.nix b/homeManagerModules/desktopEnv/hypr/default.nix index d07df172..6e394678 100644 --- a/homeManagerModules/desktopEnv/hypr/default.nix +++ b/homeManagerModules/desktopEnv/hypr/default.nix @@ -11,6 +11,7 @@ guiApps.waybar.enable = lib.mkDefault true; guiApps.mako.enable = lib.mkDefault true; guiApps.fuzzel.enable = lib.mkDefault true; + guiApps.wlogout.enable = lib.mkDefault true; guiApps.alacritty.enable = lib.mkDefault true; # Packages that should be installed to the user profile. diff --git a/homeManagerModules/desktopEnv/hypr/hyprland.conf b/homeManagerModules/desktopEnv/hypr/hyprland.conf index 3b2b0275..29424712 100644 --- a/homeManagerModules/desktopEnv/hypr/hyprland.conf +++ b/homeManagerModules/desktopEnv/hypr/hyprland.conf @@ -111,6 +111,8 @@ decoration { layerrule = blur, notifications layerrule = ignorezero, notifications + + layerrule = blur, logout_dialog } animations { @@ -180,7 +182,7 @@ bind = $mainMod, B, exec, $browser # Manage session. bind = $mainMod, C, killactive, -bind = $mainMod, M, exit, +bind = $mainMod, M, exec, wlogout bind = $mainMod, L, exec, hyprlock --immediate # Basic window management. diff --git a/homeManagerModules/guiApps/default.nix b/homeManagerModules/guiApps/default.nix index dfef6c44..657c1cd6 100644 --- a/homeManagerModules/guiApps/default.nix +++ b/homeManagerModules/guiApps/default.nix @@ -14,6 +14,7 @@ ./vsCodium ./waybar ./webCord + ./wlogout ./zoom ]; diff --git a/homeManagerModules/guiApps/wlogout/default.nix b/homeManagerModules/guiApps/wlogout/default.nix new file mode 100644 index 00000000..82519106 --- /dev/null +++ b/homeManagerModules/guiApps/wlogout/default.nix @@ -0,0 +1,30 @@ +{ pkgs, lib, config, ... }: { + + options = { guiApps.wlogout.enable = lib.mkEnableOption "Enables wlogout."; }; + + config = lib.mkIf config.guiApps.wlogout.enable { + programs.wlogout = { + enable = true; + layout = [ + { + label = "logout"; + action = "loginctl terminate-user $USER"; + text = "Logout"; + keybind = "e"; + } + { + label = "shutdown"; + action = "systemctl poweroff"; + text = "Shutdown"; + keybind = "s"; + } + { + label = "reboot"; + action = "systemctl reboot"; + text = "Reboot"; + keybind = "r"; + } + ]; + }; + }; +}