Adding current kd-win script

This commit is contained in:
David Thurstenson 2020-08-11 12:06:59 -05:00
parent 644dd35486
commit fb1012bf2e
1 changed files with 33 additions and 7 deletions

View File

@ -2,20 +2,46 @@
#kd-win: virt-viewer launcher
domain="win10"
uri="qemu+ssh://kd-laptop/system"
cmd="virt-viewer --connect=$uri"
opts=("--wait" "--reconnect" "--domain-name")
declare -A cmdstring
declare -A uri
declare -a opts
cmdstring[domain]="win10"
uri=([remote]="qemu+ssh://kd-laptop/system"
[remotespice]="spice://10.10.0.14"
[local]="qemu:///system")
case "$(uname -n)" in
kd-laptop)
cmdstring=([cmd]="virt-viewer"
[uri]=${uri[local]}
[manuri]=${uri[local]})
opts=("--connect=${cmdstring[uri]}"
"--wait"
"--reconnect"
"--direct"
"${cmdstring[domain]}")
;;
*)
cmdstring=([cmd]="remote-viewer"
[uri]=${uri[remotespice]}
[manuri]=${uri[remote]})
opts=("${cmdstring[uri]}")
;;
esac
while :; do
case $1 in
-m)
cmd="virt-manager --connect=$uri"
opts=("--show-domain-editor")
cmdstring=([cmd]="virt-manager")
opts=("--connect=${cmdstring[manuri]}"
"--show-domain-editor")
;;
*) break;;
esac
shift
done
$cmd "${opts[@]}" "${domain}" &
${cmdstring[cmd]} "${opts[@]}" &