Files
nixos/hyprland/scripts/powermenu.nix

36 lines
542 B
Nix
Raw Normal View History

2026-04-08 14:24:18 +02:00
{ lib, config, ... }:
{
home.file.".config/hypr/hyprland/scripts/powermenu.sh".text = ''
#!/bin/bash
INPUT="echo -e Lock\nLogout\nReboot\nShutdown\nSuspend"
# Execute the input command and get the selected choice
SELECTED=$($INPUT | fuzzel -d)
case "$SELECTED" in
"Lock")
hyprlock
;;
"Logout")
hyprctl dispatch exit
;;
"Reboot")
reboot
;;
"Shutdown")
shutdown now
;;
"Suspend")
systemctl suspend
;;
*)
echo "Invalid selection"
;;
esac
'';
home.file.".config/hypr/hyprland/scripts/powermenu.sh".force = true;
}