Adding current kd-win script
This commit is contained in:
parent
644dd35486
commit
fb1012bf2e
40
bin/kd-win
40
bin/kd-win
|
@ -2,20 +2,46 @@
|
||||||
|
|
||||||
#kd-win: virt-viewer launcher
|
#kd-win: virt-viewer launcher
|
||||||
|
|
||||||
domain="win10"
|
declare -A cmdstring
|
||||||
uri="qemu+ssh://kd-laptop/system"
|
declare -A uri
|
||||||
cmd="virt-viewer --connect=$uri"
|
declare -a opts
|
||||||
opts=("--wait" "--reconnect" "--domain-name")
|
|
||||||
|
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
|
while :; do
|
||||||
case $1 in
|
case $1 in
|
||||||
-m)
|
-m)
|
||||||
cmd="virt-manager --connect=$uri"
|
cmdstring=([cmd]="virt-manager")
|
||||||
opts=("--show-domain-editor")
|
opts=("--connect=${cmdstring[manuri]}"
|
||||||
|
"--show-domain-editor")
|
||||||
;;
|
;;
|
||||||
*) break;;
|
*) break;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
$cmd "${opts[@]}" "${domain}" &
|
${cmdstring[cmd]} "${opts[@]}" &
|
||||||
|
|
Loading…
Reference in New Issue