From df3ab40b064cc3a51fc6a34e935c99d559dfef9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20R=C3=B6ger?= Date: Sat, 3 May 2025 02:19:28 +0200 Subject: [PATCH] Home Gen507 @ 2025-05-03-02:16 by jonas@comfy-station --- home/jonas@comfy-station.nix | 2 +- modules/default.nix | 1 + modules/home/wlogout/config.nix | 68 -------------------------- modules/home/wlogout/default.nix | 84 ++++++++++++++++++++++++++++++-- modules/home/wlogout/wlogout.nix | 3 -- 5 files changed, 81 insertions(+), 77 deletions(-) delete mode 100644 modules/home/wlogout/config.nix delete mode 100644 modules/home/wlogout/wlogout.nix diff --git a/home/jonas@comfy-station.nix b/home/jonas@comfy-station.nix index 97c9016..26b39e0 100644 --- a/home/jonas@comfy-station.nix +++ b/home/jonas@comfy-station.nix @@ -6,7 +6,6 @@ ../modules/home/ssh.nix ../modules/home/themes/gtk ../modules/home/themes/qt - ../modules/home/wlogout ../modules/home/wofi ../modules/home/yubikey.nix ../modules/home/zsh @@ -28,6 +27,7 @@ hive.ranger.enable = true; hive.swaync.enable = true; hive.waybar.enable = true; + hive.wlogout.enable = true; hive.nix-scripts.enable = true; hive.doom.enable = true; hive.doom.enableCopilot = true; diff --git a/modules/default.nix b/modules/default.nix index bd7f784..ed1eded 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -35,5 +35,6 @@ ./home/ranger ./home/swaync ./home/waybar + ./home/wlogout ]; } diff --git a/modules/home/wlogout/config.nix b/modules/home/wlogout/config.nix deleted file mode 100644 index 0dd0343..0000000 --- a/modules/home/wlogout/config.nix +++ /dev/null @@ -1,68 +0,0 @@ -{...}: { - programs.wlogout.layout = [ - { - label = "shutdown"; - action = "systemctl poweroff"; - text = "Shutdown"; - keybind = "s"; - } - { - label = "reboot"; - action = "systemctl reboot"; - text = "Reboot"; - keybind = "r"; - } - { - label = "logout"; - action = "loginctl kill-session $XDG_SESSION_ID"; - text = "Logout"; - keybind = "e"; - } - { - label = "hibernate"; - action = "hyprlock --immediate & (sleep 1; systemctl hibernate -i)"; - text = "Hibernate"; - keybind = "h"; - } - { - label = "lock"; - action = "hyprlock"; - text = "Lock"; - keybind = "l"; - } - ]; - programs.wlogout.style = builtins.readFile ./style.css; - xdg.enable = true; - xdg.configFile = { - "wlogout/icons/hibernate.png" = { - source = ./icons/hibernate.png; - }; - "wlogout/icons/lock.png" = { - source = ./icons/lock.png; - }; - "wlogout/icons/logout.png" = { - source = ./icons/logout.png; - }; - "wlogout/icons/power.png" = { - source = ./icons/power.png; - }; - "wlogout/icons/restart.png" = { - source = ./icons/restart.png; - }; - "wlogout/icons/hibernate-hover.png" = { - source = ./icons/hibernate-hover.png; - }; - "wlogout/icons/lock-hover.png" = { - source = ./icons/lock-hover.png; - }; - "wlogout/icons/logout-hover.png" = { - source = ./icons/logout-hover.png; - }; - "wlogout/icons/power-hover.png" = { - source = ./icons/power-hover.png; - }; - "wlogout/icons/restart-hover.png" = { - source = ./icons/restart-hover.png; - }; - }; -} diff --git a/modules/home/wlogout/default.nix b/modules/home/wlogout/default.nix index c6a4c57..81d184c 100644 --- a/modules/home/wlogout/default.nix +++ b/modules/home/wlogout/default.nix @@ -1,6 +1,80 @@ -{...}: { - imports = [ - ./config.nix - ./wlogout.nix - ]; +{ + config, + lib, + ... +}: let + cfg = config.hive.wlogout; +in { + options.hive.wlogout = { + enable = lib.mkEnableOption "Enable Wlogout"; + }; + config = lib.mkIf cfg.enable { + programs.wlogout.enable = true; + programs.wlogout.layout = [ + { + label = "shutdown"; + action = "systemctl poweroff"; + text = "Shutdown"; + keybind = "s"; + } + { + label = "reboot"; + action = "systemctl reboot"; + text = "Reboot"; + keybind = "r"; + } + { + label = "logout"; + action = "loginctl kill-session $XDG_SESSION_ID"; + text = "Logout"; + keybind = "e"; + } + { + label = "hibernate"; + action = "hyprlock --immediate & (sleep 1; systemctl hibernate -i)"; + text = "Hibernate"; + keybind = "h"; + } + { + label = "lock"; + action = "hyprlock"; + text = "Lock"; + keybind = "l"; + } + ]; + programs.wlogout.style = builtins.readFile ./style.css; + xdg.enable = true; + xdg.configFile = { + "wlogout/icons/hibernate.png" = { + source = ./icons/hibernate.png; + }; + "wlogout/icons/lock.png" = { + source = ./icons/lock.png; + }; + "wlogout/icons/logout.png" = { + source = ./icons/logout.png; + }; + "wlogout/icons/power.png" = { + source = ./icons/power.png; + }; + "wlogout/icons/restart.png" = { + source = ./icons/restart.png; + }; + "wlogout/icons/hibernate-hover.png" = { + source = ./icons/hibernate-hover.png; + }; + "wlogout/icons/lock-hover.png" = { + source = ./icons/lock-hover.png; + }; + "wlogout/icons/logout-hover.png" = { + source = ./icons/logout-hover.png; + }; + "wlogout/icons/power-hover.png" = { + source = ./icons/power-hover.png; + }; + "wlogout/icons/restart-hover.png" = { + source = ./icons/restart-hover.png; + }; + }; + }; } diff --git a/modules/home/wlogout/wlogout.nix b/modules/home/wlogout/wlogout.nix deleted file mode 100644 index 5aaac8a..0000000 --- a/modules/home/wlogout/wlogout.nix +++ /dev/null @@ -1,3 +0,0 @@ -{...}: { - programs.wlogout.enable = true; -}