ubuntu 16.04 emacs24
#/usr/share/applications/emacs24.desktop
TryExec=/usr/bin/emacsclient -c
Exec=/usr/bin/emacsclient -c %F
#~/.local/share/systemd/user/emacs.service
[Unit]
Description=Emacs: the extensible, self-documenting text editor
[Service]
Type=forking
ExecStart=/usr/bin/emacs --daemon
ExecStop=/usr/bin/emacsclient --eval "(kill-emacs)"
Restart=always
Environment="DISPLAY=:0"
[Install]
WantedBy=default.target
enable it
$ systemctl --user enable emacs
And it can be started right away with:
$ systemctl --user start emacs
- to stop it
$ systemctl --user stop emacs
- to disable it
$ systemctl --user disable emacs
reference: https://streakycobra.github.io/posts/saas-or-spacemacs-as-a-service/