summaryrefslogtreecommitdiff
path: root/scripts/gui/qw
diff options
context:
space:
mode:
authorSuleyman Farajli <suleyman@farajli.net>2025-10-26 22:23:31 +0400
committerSuleyman Farajli <suleyman@farajli.net>2025-10-26 22:23:31 +0400
commitcb78290f31886fb1f9a5e7c2a764dda55a459e50 (patch)
tree72a2df0645405658d8590d4b8d7d87f1e099f596 /scripts/gui/qw
parentf8d1bfbd0f27e0763cf75fcda58d010e346515ab (diff)
chore: split script installation into CLI and GUI sections
Diffstat (limited to 'scripts/gui/qw')
-rwxr-xr-xscripts/gui/qw41
1 files changed, 41 insertions, 0 deletions
diff --git a/scripts/gui/qw b/scripts/gui/qw
new file mode 100755
index 0000000..1199227
--- /dev/null
+++ b/scripts/gui/qw
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+. slib
+
+help() {
+cat << EOF
+${0}: Qemu Wrapper, very simple script for abriviating \
+verbose qemu commands and options
+options:
+ -c create an Image.img with 10G space
+ -r [input.iso] run input.iso
+ -x [input.qcow2] run input.qcow2
+EOF
+
+exit 0
+}
+
+check_program "qemu-img"
+check_program "qemu-system-x86_64"
+
+[ $# != 2 ] && [ $# != 1 ] && invalid_use
+
+while getopts "cr:x:h" option ;do
+ case "${option}" in
+ c) run "qemu-img create -f qcow2 Image.img 10G" ;;
+
+ x) run "qemu-system-x86_64 -drive file=${OPTARG},format=qcow2 -enable-kvm -cpu host -smp 2 -m 2048 -net nic -net user -display sdl" ;;
+
+ r)
+ run "qemu-system-x86_64 -enable-kvm -cdrom ${OPTARG} \
+ -boot menu=on -drive file=Image.img -m 4G"
+ ;;
+ h) help ;;
+
+ *) invalid_use -h ;;
+
+ esac
+done
+
+# Unreachable
+invalid_use