Update rofi podman menu + new power menu
This commit is contained in:
@ -35,7 +35,7 @@ wsbind = 10, HDMI-A-2
|
|||||||
exec-once = dunst
|
exec-once = dunst
|
||||||
exec-once = hyprpaper
|
exec-once = hyprpaper
|
||||||
exec-once = kdeconnect-indicator # TODO: Only shows sometimes?
|
exec-once = kdeconnect-indicator # TODO: Only shows sometimes?
|
||||||
exec-once = nextcloud --background
|
exec-once = nextcloud # --background
|
||||||
exec-once = keepassxc
|
exec-once = keepassxc
|
||||||
# exec-once = md.obsidian.Obsidian
|
# exec-once = md.obsidian.Obsidian
|
||||||
# exec-once = firefox
|
# exec-once = firefox
|
||||||
@ -173,6 +173,7 @@ bind = $mainMod, A, exec, rofi -show drun -theme ~/NixFlake/config/rofi/rofi.ras
|
|||||||
bind = $mainMod, R, exec, rofi -show run -theme ~/NixFlake/config/rofi/rofi.rasi
|
bind = $mainMod, R, exec, rofi -show run -theme ~/NixFlake/config/rofi/rofi.rasi
|
||||||
bind = $mainMod, B, exec, rofi -show filebrowser -theme ~/NixFlake/config/rofi/rofi.rasi
|
bind = $mainMod, B, exec, rofi -show filebrowser -theme ~/NixFlake/config/rofi/rofi.rasi
|
||||||
bind = $mainMod, D, exec, ~/NixFlake/config/rofi/menus/systemd-podman.fish
|
bind = $mainMod, D, exec, ~/NixFlake/config/rofi/menus/systemd-podman.fish
|
||||||
|
bind = $mainMod, P, exec, ~/NixFlake/config/rofi/menus/power.fish
|
||||||
|
|
||||||
# Launch apps
|
# Launch apps
|
||||||
bind = $mainMod, T, exec, kitty
|
bind = $mainMod, T, exec, kitty
|
||||||
|
24
config/rofi/menus/power.fish
Executable file
24
config/rofi/menus/power.fish
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
#!/usr/bin/env fish
|
||||||
|
|
||||||
|
# User chooses option
|
||||||
|
set OPTIONS "Poweroff" "Reboot" "Reload Hyprland" "Exit Hyprland"
|
||||||
|
set OPTION (echo -e (string join "\n" $OPTIONS) | rofi -theme ~/NixFlake/config/rofi/rofi.rasi -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
|
@ -2,21 +2,21 @@
|
|||||||
|
|
||||||
# User chooses service
|
# User chooses service
|
||||||
set SERVICES (cat ~/NixFlake/config/rofi/menus/containers.txt) # TODO: This file should probably be generated by nix?
|
set SERVICES (cat ~/NixFlake/config/rofi/menus/containers.txt) # TODO: This file should probably be generated by nix?
|
||||||
set SERVICE (echo -e (string join "\n" $SERVICES) | rofi -theme ~/NixFlake/config/rofi/rofi.rasi -dmenu)
|
set SERVICE (echo -e (string join "\n" $SERVICES) | rofi -theme ~/NixFlake/config/rofi/rofi.rasi -dmenu -p "pod" -i)
|
||||||
if not contains $SERVICE $SERVICES
|
if not contains $SERVICE $SERVICES
|
||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
|
|
||||||
# User chooses action
|
# User chooses action
|
||||||
set OPS "start" "stop" "status"
|
set ACTIONS "start" "stop" "status"
|
||||||
set OP (echo -e (string join "\n" $OPS) | rofi -theme ~/NixFlake/config/rofi/rofi.rasi -dmenu)
|
set ACTION (echo -e (string join "\n" $ACTIONS) | rofi -theme ~/NixFlake/config/rofi/rofi.rasi -dmenu -p "action" -i)
|
||||||
if not contains $OP $OPS
|
if not contains $ACTION $ACTIONS
|
||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
|
|
||||||
# Execute command
|
# Execute command
|
||||||
set COMMAND_ROOT "pkexec --user root systemctl $OP podman-$SERVICE.service"
|
set COMMAND_ROOT "pkexec --user root systemctl $ACTION podman-$SERVICE.service"
|
||||||
set COMMAND_USER "systemctl $OP podman-$SERVICE.service"
|
set COMMAND_USER "systemctl $ACTION podman-$SERVICE.service"
|
||||||
set EVAL_RESULT "$(eval $COMMAND_USER)"
|
set EVAL_RESULT "$(eval $COMMAND_USER)"
|
||||||
|
|
||||||
# Display result if it exists
|
# Display result if it exists
|
||||||
|
Reference in New Issue
Block a user