On 2020-01-23 09:42, 'awokd' via qubes-users wrote:
Major Lazor:
Am 23.01.20 um 15:26 schrieb 'awokd' via qubes-users:
Major Lazor:
Is it possible to add tools or commands to the tray icon "Qubes Domains" ?
Its not exactly the same thing as adding a permanent menu for dispVm's
but I have an launch icon which calls my qvm-add-disp script in dom0.
It's simple and it works for me. You just start as many dispvm's as you
like and then click the desktop launcher icon when you need to add
another app to some dispvm instance. You could put the launcher itself
in the menu if you like, or the toolbar.
The bash script simply enumerates the currently running DispVM instances
and generates a zenity GUI listbox with check boxes, one for each
combination of dispVM/application. The script hard-codes a list of
available applications in the APPS=() list variable.
When the GUI appears I can then check off which apps I want to launch in
which specific dispVMs. When I click the Ok button it will roll through
those selected combinations and launch whatever I had selected from that
listbox in the requested dispvm instances.
All you have to do is edit the APPS=( prog1 prog1 ) list to allow for
selecting your specific applications instead of my current set of apps.
Note: I believe I had to add zenity application to my dom0, so this
script does of course have some minor security implications. But I'm ok
with that risk given the convenience that it gives me to graphically
prompt myself for little utilities like this, and where a full blown
python gui app is just too much trouble. Its simple and it works well
for the little things.
Steve
--
You received this message because you are subscribed to the Google Groups
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to qubes-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/qubes-users/97500b65-85ee-a28f-a198-c0a2e8f1bd66%40jhuapl.edu.
#!/bin/bash -xv
# list of running disp vm's
DISPNUMS=`qvm-ls --raw-list | grep -oP '(?<=disp)[0-9]+'`
idx=0
for num in `echo ${DISPNUMS[@]}`
do
VMLIST[$idx]="disp$num"
n=`expr $idx + 1`
done
#echo $VMLIST
applist=[]
applistsize=0
APPS=( nautilus firefox gedit google-chrome gnome-terminal )
# build list of disp VM's
for vm in `echo ${VMLIST[@]}`
do
for app in ${APPS[@]}
do
applist[$applistsize]="false $applistsize $vm $app"
let applistsize++
done
done
if [ $applistsize -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 $DISPVM $EXEC &
done
else
echo No disp VMs running
fi