From 3e792275de1314cd4570cb50e1dcaf4b4971cd1a Mon Sep 17 00:00:00 2001 From: natsukium Date: Thu, 16 Jan 2025 10:38:15 +0900 Subject: [PATCH] feat: add wlogout --- applications/niri/default.nix | 4 ++++ applications/niri/defaultKeyBind.nix | 3 --- homes/nixos/desktop.nix | 4 ++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/applications/niri/default.nix b/applications/niri/default.nix index a24be6d6..e7ec478a 100644 --- a/applications/niri/default.nix +++ b/applications/niri/default.nix @@ -1,5 +1,6 @@ { inputs, + config, lib, pkgs, ... @@ -24,6 +25,9 @@ in "-c" "rbw unlock && rofi-rbw -t password" ]; + # The quit action will show a confirmation dialog to avoid accidental exits. + "Mod+Shift+E".action = + if config.programs.wlogout.enable then { spawn = "wlogout"; } else { quit = { }; }; }; input = { focus-follows-mouse.enable = true; diff --git a/applications/niri/defaultKeyBind.nix b/applications/niri/defaultKeyBind.nix index cf300286..c3167c64 100644 --- a/applications/niri/defaultKeyBind.nix +++ b/applications/niri/defaultKeyBind.nix @@ -255,9 +255,6 @@ "Ctrl+Print".action.screenshot-screen = { }; "Alt+Print".action.screenshot-window = { }; - # The quit action will show a confirmation dialog to avoid accidental exits. - "Mod+Shift+E".action.quit = { }; - # Powers off the monitors. To turn them back on, do any input like # moving the mouse or pressing any other key. "Mod+Shift+P".action.power-off-monitors = { }; diff --git a/homes/nixos/desktop.nix b/homes/nixos/desktop.nix index 8c267849..84f4ed5a 100644 --- a/homes/nixos/desktop.nix +++ b/homes/nixos/desktop.nix @@ -31,6 +31,10 @@ in }; }; + programs.wlogout = { + enable = true; + }; + gtk = { enable = true; gtk3.extraConfig = {