#!/bin/bash # list of running disp vm's VMLIST=`qvm-ls --raw-list | grep disp | sed -e 's/\n//g'` applist=[] listsize=0 APPS=( nautilus firefox gedit google-chrome gnome-terminal ) # build list of disp VM's for vm in `echo ${VMLIST[@]}` do isRunning=`qvm-ls $vm | grep -c '\*'` if [ $isRunning -eq 1 ] ; then for app in ${APPS[@]} do applist[$listsize]="false $listsize $vm $app" let listsize++ done fi done if [ $listsize -gt 0 ] ; then SELECTED=`zenity --list --checklist --title="What app would you like to add?" --hide-column=2 --column="Run" --column="lineno" --column="VM" --column="App" ${applist[@]} ` for row in `echo ${SELECTED[@]} | sed -e 's/|/ /g'` do #echo $row ${applist[$row]} | awk '{print $0}' DISPVM=`echo ${applist[$row]} | awk '{print $3}'` EXEC=`echo ${applist[$row]} | awk '{print $4}'` qvm-run -p $DISPVM $EXEC done else echo No disp VMs running fi