mirror of
https://github.com/anotherhadi/nixy.git
synced 2026-04-02 11:12:09 +02:00
get back wofi for now
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
@@ -5,6 +5,47 @@
|
||||
#- - `lock` - Lock the screen. (hyprlock)
|
||||
#- - `powermode-toggle` - Toggle between performance and balanced power mode. (powerprofilesctl)
|
||||
{pkgs, ...}: let
|
||||
menu =
|
||||
pkgs.writeShellScriptBin "menu"
|
||||
# bash
|
||||
''
|
||||
if pgrep wofi; then
|
||||
pkill wofi
|
||||
else
|
||||
wofi -p "Apps" --show drun
|
||||
fi
|
||||
'';
|
||||
powermenu =
|
||||
pkgs.writeShellScriptBin "powermenu"
|
||||
# bash
|
||||
''
|
||||
if pgrep wofi >/dev/null; then
|
||||
pkill wofi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
declare -A actions=(
|
||||
[" Lock"]="hyprlock"
|
||||
[" Logout"]="hyprctl dispatch exit"
|
||||
[" Suspend"]="systemctl suspend"
|
||||
[" Reboot"]="systemctl reboot"
|
||||
[" Shutdown"]="systemctl poweroff"
|
||||
)
|
||||
|
||||
selected_option=$(
|
||||
printf '%s\n' "''${!actions[@]}" | wofi -p "Powermenu" --dmenu
|
||||
)
|
||||
|
||||
if [[ -n "$selected_option" ]]; then
|
||||
|
||||
action_command=''${actions["''$selected_option"]}
|
||||
|
||||
if [[ -n "$action_command" ]]; then
|
||||
eval "$action_command"
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
|
||||
lock =
|
||||
pkgs.writeShellScriptBin "lock"
|
||||
# bash
|
||||
@@ -25,4 +66,4 @@
|
||||
${pkgs.swayosd}/bin/swayosd-client --custom-message="Powermode set to performance" --custom-icon="emblem-default"
|
||||
fi
|
||||
'';
|
||||
in {home.packages = [lock powermode-toggle];}
|
||||
in {home.packages = [lock powermode-toggle menu powermenu];}
|
||||
|
||||
Reference in New Issue
Block a user