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_clone | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 qmenu/qmenu_vm/fqvm_clone (limited to 'qmenu/qmenu_vm/fqvm_clone') diff --git a/qmenu/qmenu_vm/fqvm_clone b/qmenu/qmenu_vm/fqvm_clone new file mode 100644 index 0000000..d31b297 --- /dev/null +++ b/qmenu/qmenu_vm/fqvm_clone @@ -0,0 +1,39 @@ +clone_name=$(: | dmenu-unlinked -p "Enter the name for the clone of $qube:") && + + option=1 + + while [ -n "$option" ]; do + + option=$(printf 'Create the clone\nAdvanced options' | dmenu-unlinked -i -l 2 -p "$qube:" | cut -f1 -d\ ) + + if [ "$option" = Advanced ]; then + + option_adv=1 + + while [ -n "$option_adv" ]; do + + option_adv=$(printf 'Class\nPool' | dmenu-unlinked -i -l 2 -p "$clone_name($qube):") + + if [ "$option_adv" = Class ]; then + + class=$(printf 'AppVM\nDispVM\nStandaloneVM\nTemplateVM' | dmenu-unlinked -i -l 4 -p "Choose a class for $clone_name:") && + + class="-C $class" + + elif [ "$option_adv" = Pool ]; then + + pool=$(qvm-pool --list | sed '1d' | dmenu-unlinked -i -l 10 -p "Select a pool for $clone_name:" | cut -f1 -d\ ) && + + pool="-P $pool" + fi + done + + elif [ "$option" = Create ]; then + + unset option + + cp -n "$HOME/.local/share/qubes-notes/$qube" "$HOME/.local/share/qubes-notes/$clone_name" + + qvm-clone $class $pool "$qube" "$clone_name"& + fi + done -- cgit v1.2.3