1

Introduce rofi lib func for simple chooser-action menu

This commit is contained in:
2023-05-25 19:58:23 +02:00
parent 3d72b59df5
commit ad604ef4a4
4 changed files with 70 additions and 36 deletions

View File

@ -87,7 +87,7 @@ bind = $mainMod, A, exec, rofi -show drun
# bind = $mainMod, R, exec, rofi -show run
# bind = $mainMod, B, exec, rofi -show filebrowser
bind = $mainMod, D, exec, ~/NixFlake/config/rofi/menus/systemd-podman.fish
bind = $mainMod, escape, exec, ~/NixFlake/config/rofi/menus/power.fish
bind = $mainMod, escape, exec, rofi-menu-power
bind = $mainMod, O, exec, ~/NixFlake/config/rofi/menus/lectures.fish
bind = $mainMod, M, exec, ~/NixFlake/config/rofi/menus/keybinds.fish
bind = $mainMod, U, exec, ~/NixFlake/config/rofi/menus/vpn.fish

View File

@ -1,24 +0,0 @@
#!/usr/bin/env fish
# User chooses option
set OPTIONS "Poweroff" "Reboot" "Reload Hyprland" "Exit Hyprland"
set OPTION (echo -e (string join "\n" $OPTIONS) | rofi -dmenu -p " power " -i)
if not contains $OPTION $OPTIONS
exit
end
# Set command
if test "Poweroff" = $OPTION
set ACTION "poweroff"
else if test "Reboot" = $OPTION
set ACTION "reboot"
else if test "Reload Hyprland" = $OPTION
set ACTION "hyprctl reload"
else if test "Exit Hyprland" = $OPTION
set ACTION "hyprctl dispatch exit"
else
exit
end
# Execute command
eval $ACTION