emersion / hydroxide

A third-party, open-source ProtonMail CardDAV, IMAP and SMTP bridge
MIT License
1.63k stars 126 forks source link

app: how to add the app to "autostart" on linux? #233

Closed gucio321 closed 2 years ago

gucio321 commented 2 years ago

I've tried adding it to .bash_profile, but, since bash_profile waits for exit status, gnome-session failed to load at all how to do this correctly?

dvalter commented 2 years ago

If your system runs systemd, you may add user service to /etc/systemd/user or ~/.config/systemd/user with the following content (use your hydroxide binary path) and it should run hydroxide on login more reliably than with bashrc/bash_profile.

[Unit]
Description=Hydroxide (Protonmail proxy) service

[Service]
ExecStart=/path/to/hydroxide serve
Type=simple
Restart=always
RestartSec=30

[Install]
WantedBy=default.target
gucio321 commented 2 years ago

okey, it works, thank you!