Add commands to the dom0 menu

111 views
Skip to first unread message

Chris Seekamp

unread,
Dec 22, 2016, 3:28:52 PM12/22/16
to qubes-devel
I installed Qubes OS R3.2 yesterday. I have a thinkpad t450s and I use the trackpoint. I have a little utility to toggle on/off the trackpad. So after starting qubes I currently have to open up the Terminal Emulator for dom0 and execute the command. I would like to be able to put an entry in the menu (perhaps below "Terminal Emulator") to execute my utility. I also will probably be writing a program that allows me to assign a USB device attached to the sys-usb-proxy to an AppVM. Right now I have to run a sequence of commands in the terminal emulator to do this every time I want to use my USB headset. Once I have this program written, I would like to be able to invoke it from the menu as well. I see documentation on AppVM menus but not on the one for dom0. I think I have to execute these things only from dom0.

Can someone point me to documentation for updating the dom0 menu, or if there is none, tell me which code package to grab so I can look at how this is done?

Also, in case I want to write a GUI to do the second program I mentioned, can someone recommend which toolkit to use based on what is being used elsewhere in Qubes OS? I prefer using python (perhaps pygtk?) but I could use C/C++ as well if absolutely necessary.

Thanks.

Grzesiek Chodzicki

unread,
Dec 22, 2016, 4:44:08 PM12/22/16
to qubes-devel
1. In order to attach your USB headset to an appvm using one command do it like this: qvm-usb -a vmname $(qvm-usb|grep -i NAMEYOURHEADSETHERE|cut -f1), now you have a single line of bash to attach your headset. This can be bound to a keyboard shortcut using XFCE keyboard menu. Alternatively you can create a menu entry by saving this command as a bash script, making it executable (and giving the non-root use permission to execute it) and then saving it in /usr/share/applications

Chris Seekamp

unread,
Dec 22, 2016, 5:21:56 PM12/22/16
to qubes-devel
Thanks for that. I can certainly do something like that, although I was thinking of doing something generic which allows me to first choose the usb device and then choose the target VM.

As far as the menu stuff goes, I first created a .desktop file in /usr/share/applications pointing to the utility and with "Categories=System;". Then I found the /etc/xdg/menus/xfce-applications.menu. I added my entry after the exo-terminal.desktop one. After restarting Qubes my utility showed up under "System Tools" and I was able to click on it to execute it.  So my concern now is how often will I have to redo this? That is, when does that file get replaced via update or whatever?

Grzesiek Chodzicki

unread,
Dec 22, 2016, 5:55:19 PM12/22/16
to qubes-devel
Dunno frankly, I have a few of those scripts bound to keyboard shortcuts for a few months now and so far they work flawlessly. But the optimal solution here if the qvm-usb tool was integrated with the GUI the same way qvm-block is.

Andrew David Wong

unread,
Dec 23, 2016, 2:59:44 AM12/23/16
to Chris Seekamp, qubes-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Take a look at the Xfce4 documentation: http://docs.xfce.org/

- --
Andrew David Wong (Axon)
Community Manager, Qubes OS
https://www.qubes-os.org
-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJYXNljAAoJENtN07w5UDAw1MUP/2SVFcwQ/5UDWniAN/AvZzxT
GE7Cw1N+POHqS1/60HUrfhANTSdTbxmfGSWAcg+EURftpvX6OWRcb92pWWPCJaif
ByC1Pc79WHsHyodgFsY8oB+VoYPxQnF990OcLyufjdQ6YUj0rfzyVIJj0OGFafvX
RwGiaFIBWbGlcy8U5pqeqgX2k8/nykh95vZbx+0wWRJsEqh/HUkmwXPy2mVJHpfa
ozVs3cm0jA/fWXHvP44L5LuRkm/qYpbSJOGh5wBTQ/zf2wlXUZPYADADcfdu8mFg
axQtRIHA9X7nA+Jqm4Mnhnw3SmoHYMzTxQCWfhHRbOBrPo0gFJPKXmBHobLpIDSr
HxpjHfuZ3auaKiHbf1Gbru8I8mYGF4EyMoMw91WX3HAdcHWC/EWGzC5Qyekn7F1m
biW+h5/jJB7nmIisH9h55nJtwfK35ATq7PupVeCjpQEe8ByiE71oTL5rHywVB6pR
k+R+ov2nFzhMuNrUCQdNRP/i99iDcUqM8TAKd1H33BqkBDauF4QC8yAPr2DZaWfl
iXokZzUYp4dDxkEam4qYjg40M4qb/VbvTek5isB8qo/Pk9NyZQZVu9LUVOtWpCux
jC3LlcLNWGVR2sNCxElbXwA6sWTtrwFk4Rt9Cl3b4FIREGXBv29BkNOB6j3HZGhT
boUGSqu7XWuhoKCNYHAg
=ttgg
-----END PGP SIGNATURE-----

Andrew David Wong

unread,
Dec 23, 2016, 3:03:29 AM12/23/16
to Chris Seekamp, qubes-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

To expound: My understanding is that qvm-sync-appmenus automatically
overwrites manual config for AppVM shortcuts in that menu, but not the
whole menu. This is why I suspect the Xfce4 docs are your best bet for
an entry for a custom dom0 shortcut/script, but Marek may be able to
shed more light on this.

Also, if it turns out that what you really want is a custom AppVM
shortcut, take a look here:

https://www.qubes-os.org/doc/managing-appvm-shortcuts/

(Note: This page hasn't been updated in a while, but there are recent
threads on the MLs about this, so try some searching.)

- --
Andrew David Wong (Axon)
Community Manager, Qubes OS
https://www.qubes-os.org
-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJYXNpIAAoJENtN07w5UDAw0dcQAJYUuLA2APA6UQxBIG5D3657
5wlFBTOSELSKo0R2ouzDkTaMebcPMjeFNLypg+eHbqkZ3AEIY4KpF0F+tcsY30Ey
1aC42BQ8WvhKsVuj/h8Isy2Ba6FgmBxurNB8F/QO40LG8GukxycfL3u0vkMwgUFI
N7kkUQCBPEQoPZq+gECHuLbkVryBWMRL8z6YYs4W1nK1ToJ1pgOBr5JpqWLSCkvq
mWMp5bgrdXgaodUyl0S3gLMOB+1xPEOvvkYLvUAz3bJyK/BqqJtTxQtP+I+wP4ir
Yrhfcs5wmZ06zv1ZlYQ6p4DSmnNIWkBrHFt+GbcKd5aaggUKERA9UQy+CbCgzok5
kC6aOntYZHxBbkfqdqNnISPiG7M/H3sMggLEwil5gH+7Yn+p+v+Tp9xr64+CMMjU
zowGGQXAtD1gk86sBKpL3p8mS6F/njjdNSyT8STA/TIFy47FnXqZjPccN+Iesn7g
BZIuJGcUVkW0kDELXkhFJ2FQs1XZ4xAtga2vh0iz6z1RUCtaZ15SJEownWWF3JmF
4WSjpPdeNUANw/ChrqtAgABnMnbCNx1X0VCMbfaJHf50Vc4FvliBXTzP6KrJoFxT
gtngnNrJAk1e7TlIcAJ6enisf2lEafJDQIShtdyoceUINEEfLcT8Ocz6XoxeWeq+
VcMTNH6N8PZIOblIvw4x
=Md8s
-----END PGP SIGNATURE-----

Reply all
Reply to author
Forward
0 new messages