{pkgs, ...}: let
  shutdown-menu = pkgs.writeShellScriptBin "shutdown-menu" ''
    #!/bin/sh

    text=$(wl-paste)

    options=(
        "Shutdown "
        "Reboot "
        "Suspend 󰤄"
        "Exit Hyprland 󰍃"
    )

    selected_option=$(printf "%s\n" "''${options[@]}" | fuzzel -d -p "Select an option:")


    # TODO: Find way to do this without root
    case $selected_option in
        "Shutdown ")
            systemctl poweroff
            ;;
        "Reboot ")
            systemctl reboot
            ;;
        "Suspend 󰤄")
            systemctl suspend
            ;;
        "Exit Hyprland 󰍃")
            hyprctl dispatch exit
            ;;
        *)
            echo "Invalid option"
            exit
            ;;
    esac
  '';
in {
  environment.systemPackages = [shutdown-menu];
}
