summaryrefslogtreecommitdiff
path: root/qmenu/qmenu_vm/fqvm_clone
diff options
context:
space:
mode:
authorCasper <me@skylarcloud.xyz>2024-12-23 17:13:45 -0700
committerCasper <me@skylarcloud.xyz>2024-12-23 17:13:45 -0700
commit01a33ab0913d439150065ac23644c4f140ff8917 (patch)
tree9ad71bd7e6f5a5aad2c2cdbff4bb75de12565998 /qmenu/qmenu_vm/fqvm_clone
parent7b5a0e9e88f015cb68a46bb657661f4663e287af (diff)
added qmenu!
Diffstat (limited to 'qmenu/qmenu_vm/fqvm_clone')
-rw-r--r--qmenu/qmenu_vm/fqvm_clone39
1 files changed, 39 insertions, 0 deletions
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