From 5c0ff247158d36dbc14f3461169e16d3dff2f6d8 Mon Sep 17 00:00:00 2001 From: Crony Akatsuki Date: Wed, 5 Feb 2025 17:28:14 +0100 Subject: [PATCH] Tofi script for powering off or rebooting. --- modules/home-manager/hyprland.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/home-manager/hyprland.nix b/modules/home-manager/hyprland.nix index 4bc9ff5..f19b048 100644 --- a/modules/home-manager/hyprland.nix +++ b/modules/home-manager/hyprland.nix @@ -51,6 +51,14 @@ fi ''; + power-menu = pkgs.writeShellScriptBin "power-menu" '' + #!/usr/bin/env sh + + case "$(printf "shutdown\\nreboot" | tofi --prompt "Choose your poison")" in + "shutdown") poweroff ;; + "reboot") reboot ;; + esac + ''; in { options = { crony.hyprland.enable = lib.mkEnableOption "Enable hyprland and configure it for me"; @@ -364,6 +372,7 @@ in { "$mod, G, exec, ${hyprgamemode}/bin/gamemode" "$mod, F1, exec, ${toggle-sound-output}/bin/toggle-sound-output" + "$mod SHIFT, E, exec, ${power-menu}/bin/power-menu" "$mod, V, exec, cliphist list | tofi --horizontal false --height 380 | cliphist decode | wl-copy"