mirror of
https://github.com/oSoWoSo/DistroHopper.git
synced 2024-08-14 22:46:53 +00:00
delete vm gum --choose-if-one
This commit is contained in:
parent
696dcc822d
commit
187120fac8
1 changed files with 17 additions and 25 deletions
12
qrun
12
qrun
|
@ -30,7 +30,6 @@ _define_variables() {
|
|||
export GUM_FILTER_PROMPT_FOREGROUND="$color"
|
||||
export GUM_FILTER_SELECTED_PREFIX_FOREGROUND="$color"
|
||||
export GUM_FILTER_SELECTED_PREFIX_BORDER_FOREGROUND="$color"
|
||||
|
||||
}
|
||||
|
||||
_generate_supported(){
|
||||
|
@ -109,7 +108,6 @@ show_headers() {
|
|||
vms_run+="$running_logo$instance "
|
||||
done
|
||||
fi
|
||||
#vms_not=($(comm -23 <(printf "%s\n" "${vms[@]}" | rev | cut -d'.' -f2-9 | rev | sort) <(printf "%s\n" "${vms_running[@]}" | sort)))
|
||||
mapfile -t vms_not < <(comm -23 <(printf "%s\n" "${vms[@]}" | rev | cut -d'.' -f2-9 | rev | sort) <(printf "%s\n" "${vms_running[@]}" | sort))
|
||||
vms_not_next=$(gum style < <(printf '%s\n' "${vms_not[@]}"))
|
||||
if [ -n "$(find . -name '*.pid')" ]; then
|
||||
|
@ -232,10 +230,10 @@ kill_vms() {
|
|||
show_headers
|
||||
fi
|
||||
}
|
||||
# test
|
||||
|
||||
gum_choose_VM_to_delete() {
|
||||
if [ -n "$(echo *.conf)" ]; then
|
||||
chosen=$(echo "${vms[@]%.*}" | tr " " "\n" | gum choose)
|
||||
chosen=$(echo "${vms[@]%.*}" | tr " " "\n" | gum choose --select-if-one)
|
||||
gum confirm "Really delete $chosen" && rm -r "$chosen" && rm "$chosen".conf
|
||||
show_headers
|
||||
else
|
||||
|
@ -254,12 +252,6 @@ need Nerd Fonts" && echo "yes" > /tmp/icons || rm /tmp/icons
|
|||
show_headers
|
||||
}
|
||||
|
||||
icons_or() {
|
||||
gum confirm " Use icons?
|
||||
need Nerd Fonts" && echo "yes" > /tmp/icons || rm /tmp/icons
|
||||
show_headers
|
||||
}
|
||||
|
||||
# MENU
|
||||
_show_menu() {
|
||||
while true
|
||||
|
|
Loading…
Reference in a new issue