How to add Davmail (Launch Script) to the qubes menu

34 views
Skip to first unread message

799

unread,
Oct 23, 2018, 10:52:35 PM10/23/18
to qubes...@googlegroups.com
Hello,

I am using DavMail to have my email AppVM connect to our corporate Exchange Server (using offlineimap+neomutt and Thunderbird) as mail client.

I would like to launch DavMail from the Qubes Menu or maybe even with the start of the Email AppVM.
DavMail is started via a script, which then launches a Java application which also has it own tray icon.

How can I add a script to the qubes menu?

The first step would be to write a successfully qvm-run command and run it from dom0 so that DavMail launches. After that I can create a . desktop file as described in the Qubes docs.

The first idea was to try:
qvm-run -q -a --service -- my-bizmail qubes.StartApp+/home/user/davmail/davmail.sh

... Which doesn't work. 
If someone points me into the right direction I would also add this to the qubes docs.

- O

Sven Semmler

unread,
Oct 23, 2018, 11:05:54 PM10/23/18
to 799, qubes...@googlegroups.com
On Oct 23, 2018, at 10:52 PM, 799 <one7...@gmail.com> wrote:
>
> qvm-run -q -a --service -- my-bizmail qubes.StartApp+/home/user/davmail/davmail.sh

qvm-run -a my-bizmail davmail/davmail.sh &

... will do the trick. I run a setup with DavMail and Thunderbird on a fedora-28-minimal based template. For some reason .config/autostart-scripts doesn’t work for me but when I put a .desktop shortcut into .config/autostart it does.

So DavMail just starts and is visible in the tray every time the app-email qube is running.

/Sven

799

unread,
Oct 24, 2018, 2:38:18 AM10/24/18
to Sven Semmler, qubes...@googlegroups.com
Hello Sven,


Sven Semmler <Sv...@svensemmler.org> schrieb am Mi., 24. Okt. 2018, 05:05:

qvm-run -a my-bizmail davmail/davmail.sh &

... will do the trick. I run a setup with DavMail and Thunderbird on a fedora-28-minimal based template.

Thanks for the answer, I suceeded adding a .desktop file for Davmail.
This is how it works (to have it added to mailng archive)

1) launch the Template VM on which your email-AppVM which has DavMail installed is running

2) Create a new .desktop file
    bash-4.4# nano /usr/share/applications/davmail.desktop

[Desktop Entry]
Name=DavMail
GenericName=DavMail
Comment=Exchange-to-IMAP Bridge
Exec=/home/user/bin/davmail/davmail.sh
Terminal=false
Type=Application
Encoding=UTF-8
Icon=xterm-color
Categories=Network;Email;
X-Desktop-File-Install-Version=0.23

3) while the template is still running sync app-menus in dom0
[user@dom0 ~]$ qvm-sync-appmenus <NAME-OF-MAILTEMPLATEVM>

4) Add the new Shortcut to the menu of your Email-AppVM via Qubes Settings

As far as I found out via Google Search ~/.config/autostart will only run .desktop files.
You might also want to look at this solution:

-[ Content from the above link, which I haven't tried yet ]-
Create a desktop file which will start a ("helper")script which will run othr scripts from a certain location.

[Desktop Entry]
Exec=autostart-exec.sh
Icon=system-run
# NotShowIn=GNOME # Run in all X environments
Terminal=false
TerminalOptions=
Type=Application

This referenced a script that would call each script in the autostart-scripts directory (using the directory determination from the Autostart spec):

#!/bin/sh

shopt -s nullglob # Ensure shell expansion with 0 files expands to an empty list, rather than trying to read the "*.sh" file

if [ -z "$XDG_CONFIG_HOME" ]; then
    XDG_CONFIG_HOME=~/.config
fi
for f in "$XDG_CONFIG_HOME/autostart-scripts/"*.sh; do
    test -x "$f" && . "$f" || true
done

regards

- O

799

unread,
Oct 24, 2018, 2:50:56 AM10/24/18
to Sven Semmler, qubes...@googlegroups.com
The last thing which is _not_ working is to run Neomutt in a gnome-termianl from the menu.
If I run the following command from a terminal in the Email APppVM neomutt will start:
gnome-terminal --command "neomutt"

Therefor I have created the following neomutt.desktop file in the template VM:
/usr/share/applications/neomutt.desktop

[Desktop Entry]
Name=NeoMutt
GenericName=NeoMutt
Comment=A plain Text Email Reader
Exec=gnome-terminal --command "neomutt"

Terminal=false
Type=Application
Encoding=UTF-8
Icon=xterm-color
Categories=Network;Email;
X-Desktop-File-Install-Version=0.23

But if qvm-sync-appmenus this in dom0 and it to the AppVM menu and launch it, nothing happens.

Any idea what the missing part ist?

- O

Reply all
Reply to author
Forward
0 new messages