From 02ab15aad47cbc8bef2d2c09a4365b347144954c Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Fri, 13 Dec 2024 23:23:28 +0100 Subject: [PATCH] home/programs/wlogout: add wlogout --- home/programs/wlogout.nix | 66 +++++++++++++++++++++++++++++++++++++++ hosts/vamos/default.nix | 1 + 2 files changed, 67 insertions(+) create mode 100644 home/programs/wlogout.nix diff --git a/home/programs/wlogout.nix b/home/programs/wlogout.nix new file mode 100644 index 0000000..8423a8e --- /dev/null +++ b/home/programs/wlogout.nix @@ -0,0 +1,66 @@ +{ + config, + lib, + pkgs, + ... +}: { + programs.wlogout = { + enable = true; + + layout = let + systemd = let + systemd = lib.getExe' pkgs.systemd; + in { + loginctl = systemd "loginctl"; + systemctl = systemd "systemctl"; + }; + in [ + { + action = "${systemd.loginctl} lock-session"; + keybind = "l"; + label = "lock"; + text = "Lock"; + } + + { + action = "${systemd.systemctl} hibernate"; + keybind = "h"; + label = "hibernate"; + text = "Hibernate"; + } + + { + action = "${ + systemd.loginctl + } terminate-user ${ + config.home.username + }"; + + keybind = "q"; + label = "logout"; + text = "Logout"; + } + + { + action = "${systemd.systemctl} poweroff"; + keybind = "p"; + label = "shutdown"; + text = "Shutdown"; + } + + { + action = "${systemd.systemctl} suspend"; + keybind = "s"; + label = "suspend"; + text = "Suspend"; + } + + { + action = "${systemd.systemctl} reboot"; + keybind = "r"; + label = "reboot"; + text = "Reboot"; + } + ]; + }; +} diff --git a/hosts/vamos/default.nix b/hosts/vamos/default.nix index d423f96..26deb2d 100644 --- a/hosts/vamos/default.nix +++ b/hosts/vamos/default.nix @@ -39,6 +39,7 @@ in { "${home}/services/swaync" "${home}/programs/swaybg.nix" + "${home}/programs/wlogout.nix" "${home}/services/syncthing.nix"