Skip to content

Instantly share code, notes, and snippets.

@BlackDex
Last active April 29, 2021 20:13
Show Gist options
  • Save BlackDex/dbf08c80ac8b78714f9d3b82ef5958a9 to your computer and use it in GitHub Desktop.
Save BlackDex/dbf08c80ac8b78714f9d3b82ef5958a9 to your computer and use it in GitHub Desktop.
Have DavMail as a Tray Icon in Gnome-Shell

Have DavMail as a Tray Icon in Gnome-Shell

DavMail is a java application which could use swt for a tray-icon, which has worked fine since somewhere during and before Ubuntu 16.04 with some tweaks.
But it does not work anymore in Gnome-Shell environments. This can be mitigated via some small adjustments and installing a Gnome-Shell Extension.

Install gnome-shell extension

First install the following gnome-shell extension Minimize to Tray.

Change davmail.desktop file

Locate the davmail.desktop file first for your environment.
This can be done several ways.

Run these actions as root/sudo:

# Via mlocate
# Update the database first
updatedb

# Search for the .desktop file
locate -ie 'davmail.desktop'

# OR #

# Via find
find / -type f -iname 'davmail.desktop'

It probably found a match somewhere in /usr/share/applications. Copy that file to your local applications directory "$HOME/.local/share/applications/"

desktop-file-install --dir="${HOME}/.local/share/applications" /usr/share/applications/davmail.desktop

Open that file and edit/add (at the bottom) the following options.

Exec=davmail -notray
StartupWMClass=davmail-DavGateway

After this refresh the local applications desktop directory.

update-desktop-database -v ${HOME}/.local/share/applications/

Make sure you have DavMail started via the Applications menu.
After this, you can open the settings of the 'Minimize to Tray' extension via gnome-tweaks > Extensions > Minimize to tray > Gear Icon.
Click on the Plus (+) sign in the top-right of the window, and start typing DavMail, it should show you a list with available options, click on it.
This should put an icon on the tray immediately with the DavMail icon. If you now minimize the window, or click that tray icon it will disappear from the windows list.

@ismaellimo
Copy link

Thank you!!! i love you!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment