1

Update rofi podman menu + new power menu

This commit is contained in:
2023-04-25 10:56:55 +02:00
parent 0903fdd4dd
commit 82edb7d43c
3 changed files with 32 additions and 7 deletions

View File

@ -2,21 +2,21 @@
# User chooses service
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
exit
end
# User chooses action
set OPS "start" "stop" "status"
set OP (echo -e (string join "\n" $OPS) | rofi -theme ~/NixFlake/config/rofi/rofi.rasi -dmenu)
if not contains $OP $OPS
set ACTIONS "start" "stop" "status"
set ACTION (echo -e (string join "\n" $ACTIONS) | rofi -theme ~/NixFlake/config/rofi/rofi.rasi -dmenu -p "action" -i)
if not contains $ACTION $ACTIONS
exit
end
# Execute command
set COMMAND_ROOT "pkexec --user root systemctl $OP podman-$SERVICE.service"
set COMMAND_USER "systemctl $OP podman-$SERVICE.service"
set COMMAND_ROOT "pkexec --user root systemctl $ACTION podman-$SERVICE.service"
set COMMAND_USER "systemctl $ACTION podman-$SERVICE.service"
set EVAL_RESULT "$(eval $COMMAND_USER)"
# Display result if it exists