From 5ef5639466093cd68150a153482b8c947ff2efa4 Mon Sep 17 00:00:00 2001 From: caley Date: Wed, 20 May 2026 09:19:37 +0000 Subject: Add power management script with options --- nixos/cat.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/nixos/cat.nix b/nixos/cat.nix index 29c061a..ac28a92 100644 --- a/nixos/cat.nix +++ b/nixos/cat.nix @@ -380,5 +380,27 @@ ''; }; +home.packages = with pkgs; [ + (writeShellScriptBin "power" '' + options="lock\nlogout\nshutdown\nreboot" + choice=$(echo -e "$options" | ${pkgs.rofi}/bin/rofi -dmenu -i -p ">") + + case "$choice" in + lock) + ${pkgs.hyprlock}/bin/hyprlock + ;; + logout) + command -v hyprshutdown >/dev/null 2>&1 && hyprshutdown || ${pkgs.hyprland}/bin/hyprctl dispatch exit + ;; + shutdown) + shutdown now + ;; + reboot) + reboot + ;; + esac + '') + ]; + programs.home-manager.enable = true; } -- cgit v1.3.1