I don’t know why, but I’m having an issue with the system tray icon always showing as a generic one in GNOME 48. It’s this issue:
So, I disabled it completely, as it’s bugging me so much. But then, it wouldn’t run in the background on closing. Here’s how I work around it.
Create a user systemd service file at ~/.config/systemd/user/mailspring.service:
[Unit]
Description=Mailspring in the background
RequiresMountsFor=/run/user/1000/containers
[Service]
Type=exec
ExecStart=/usr/bin/distrobox-enter -n dev-dbx -- mailspring --background
Restart=always
RestartSec=15
TimeoutStopSec=30
This will always start Mailspring in the background again in 15 secs after you close it.
Replace the ExecStart= value to match the one in your desktop file, plus --background at the end.
Remove RequiresMountsFor=/run/user/1000/containers if you don’t install Mailspring in the container.
Here’s a timer file ~/.config/systemd/user/mailspring.timer to make it runs automatically on startup:
[Unit]
Description=Start Mailspring service with some delay.
[Timer]
OnStartupSec=20
RandomizedDelaySec=10
Persistent=true
[Install]
WantedBy=timers.target
Then, enable the timer:
systemctl --user daemon-reload && systemctl --user enable mailspring.timer
Note, if you enable the timer, you don’t have to enable the service, as the service (Mailspring in the background) would be triggered by the timer.