Add power menu to hyprland
This commit is contained in:
parent
4e7fcaf3a5
commit
c5c233509c
2 changed files with 23 additions and 0 deletions
12
misc/power-menu.sh
Executable file
12
misc/power-menu.sh
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
cmds=('shutdown now' 'reboot' 'hyprlock' 'hyprctl dispatch exit')
|
||||
|
||||
count=${#cmds[@]}
|
||||
default=15
|
||||
|
||||
lines=$((count > default ? default : count))
|
||||
|
||||
a=$(printf ' Shut down\n Reboot\n Lock\n Log out' | fuzzel --dmenu --index --lines $lines --placeholder "Power action: " -I)
|
||||
|
||||
if [ -n "$a" ]; then
|
||||
${cmds[a]}
|
||||
fi
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
|
|
@ -43,6 +44,16 @@ in {
|
|||
params = "pkill waybar || waybar";
|
||||
}
|
||||
|
||||
{
|
||||
flags = [];
|
||||
mods = ["SUPER"];
|
||||
key = "P";
|
||||
dispatcher = "exec";
|
||||
params = let
|
||||
a = pkgs.writeShellScriptBin "power-menu" (builtins.readFile ../../../misc/power-menu.sh);
|
||||
in "pkill fuzzel || ${a}/bin/power-menu";
|
||||
}
|
||||
|
||||
{
|
||||
flags = [];
|
||||
mods = ["SUPER"];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue