emacs.service 862 B

123456789101112131415161718192021222324252627
  1. [Unit]
  2. Description=Emacs text editor
  3. Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/
  4. [Service]
  5. Type=notify
  6. # ExecStart=emacs --fg-daemon
  7. # ExecStop=emacsclient --eval "(save-buffers-kill-emacs)"
  8. ExecStart=/home/adam/.local/bin/emacs --fg-daemon
  9. ExecStop=/home/adam/.local/bin/emacsclient --eval "(save-buffers-kill-emacs)"
  10. # Emacs will exit with status 15 after having received SIGTERM, which
  11. # is the default "KillSignal" value systemd uses to stop services.
  12. SuccessExitStatus=15
  13. # The location of the SSH auth socket varies by distribution, and some
  14. # set it from PAM, so don't override by default.
  15. # Environment=SSH_AUTH_SOCK=%t/keyring/ssh
  16. Restart=always
  17. RestartSec=2
  18. # Post-start notification command (optional)
  19. ExecStartPost=/usr/bin/notify-send "Emacs Daemon" "Emacs has successfully started."
  20. [Install]
  21. WantedBy=default.target