From 01a33ab0913d439150065ac23644c4f140ff8917 Mon Sep 17 00:00:00 2001 From: Casper Date: Mon, 23 Dec 2024 17:13:45 -0700 Subject: added qmenu! --- qmenu/qmenu_vm/fqvm_volume | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 qmenu/qmenu_vm/fqvm_volume (limited to 'qmenu/qmenu_vm/fqvm_volume') diff --git a/qmenu/qmenu_vm/fqvm_volume b/qmenu/qmenu_vm/fqvm_volume new file mode 100644 index 0000000..8b762e0 --- /dev/null +++ b/qmenu/qmenu_vm/fqvm_volume @@ -0,0 +1,26 @@ +qube_class=$(qvm-ls --raw-data -O flags "$qube" | cut -c 1) + +if [ "$qube_class" = t ] || [ "$qube_class" = s ] || [ "$qube_class" = S ]; then + + volume=$(printf 'Root\nPrivate' | dmenu-unlinked -l 2 -i -p "$qube:" | awk '{print tolower($0)}') +else + volume=private +fi + +if [ -n "$volume" ]; then + + current_storage=$(( $(qvm-volume info "$qube:$volume" size) / 1048576 )) + + mebibyte=$(echo "$current_storage" | dmenu-unlinked -p "Enter the maximum size of $volume storage in MiB to be allocated to $qube:") && + + if [ "$mebibyte" -gt "$current_storage" ]; then + + byte=$(( mebibyte * 1048576 )) + + nyprompt "Increase the maximum $volume storage size of $qube from $current_storage MiB to $mebibyte MiB?" && + + (qvm-volume extend "$qube:$volume" "$byte"&) + else + echo Go back... | dmenu-unlinked -p "Warning: Unable to decrease the maximum $volume storage!" > /dev/null 2>&1 + fi +fi -- cgit v1.2.3