How to make mailspring open to tray on startup linux mint 20.1

I used to be able to have it launch to the system tray but after reinstalling my OS I have been unable to find a way to launch it to tray on system startup on linux mint 20 and 20.1. Is there anyone that knows the solution to my problem.

You can add Mailspring to your Startup Applications. Just hit the Super Key and type “startup”. Select Startup Applications. Select the “+” at the bottom and then “Choose Application”. Search for Mailspring in the app list, select it, and click “Add Application”. Once added, you can configure it with the pencil icon at the bottom to delay start n number of seconds.

I have that set up and it opens maximised on startup. I am looking for a way to minimise it to the system tray on startup.

1 Like

If you have two startup items, it will show, though not maximized in my experience. I somehow had two startup items. The first loaded it to the system tray, and the 2nd caused it to show the app.

In the general preferences, do you have “Launch on system start” and “Show icon in menu bar / system tray” checked? I have those two checked with ONE startup item, and it starts reliable minimized to the system tray.

There was an issue with similar behaviour on mac some time back [1]. Maybe this is a similar issue. On a different case, there was the problem that a default setting could not be detected.

@SirChipalot can you try to run mailspring --background and see if this works? Can you please check the autostart file (usually ~/.config/autostart/Mailspring.desktop) and paste its content here?

[1]

Running mailspring --background works and here is the contents of the autostart file:

[Desktop Entry]
X-SnapInstanceName=mailspring
Name=Mailspring
Comment=The best email app for people and teams at work
GenericName=Mail Client
Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/mailspring_mailspring.desktop /snap/bin/mailspring %U
Icon=/snap/mailspring/488/usr/share/pixmaps/mailspring.png
Type=Application
StartupNotify=true
StartupWMClass=Mailspring
Categories=GNOME;GTK;Network;Email;
Keywords=email;internet;
MimeType=x-scheme-handler/mailto;x-scheme-handler/mailspring;
X-GNOME-Autostart-enabled=true
NoDisplay=false
Hidden=false
Name[en_GB]=Mailspring
Comment[en_GB]=The best email app for people and teams at work
X-GNOME-Autostart-Delay=0

1 Like

This autostart file is missing the --background part. What happens if you untick and tick “Launch on system start”? The Exec part should contain the background flag. If this does not work, as a workaround, you may try to change it to:

Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/mailspring_mailspring.desktop --background %U

I cannot find the launch on system start setting in mailspring and adding the line in place of the old Exec= line causes it to not launch on system start
I have tried reinstalling but nothing changes

Screenshot from 2021-05-26 22-21-11

Interesting. Looking at your desktop file, I assume that you are using the snap version? Ist this correct?

I will need to have another look at this. You may try installing the .deb version instead.

I am using the snap version i will try and install the .deb version

After installing the .deb version everything is working as i wanted. I didn’t even realise there were multiple versions compatible with mint and that it was just snap or aur so you bringing attention to the .deb version helped.

1 Like

If you’re using the snap version, what you can try is add the below command to your startup applications.

mailspring -b

The -b flag runs the client in background so the client’s UI doesn’t launch but the app does and it shows in your system tray. But yes, since it is a snap app, it takes some time to load so wait for 10-15s after startup, it should load automatically.