[Unit] Description=Emacs text editor Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/ ConditionPathExists=%h/.local/bin/distrobox/emacs [Service] Type=simple ExecStart=%h/.local/bin/distrobox/emacs --fg-daemon ExecStop=%h/.local/bin/distrobox/emacsclient --eval "(kill-emacs)" Environment=SSH_AUTH_SOCK=%t/gnupg/S.gpg-agent.ssh Environment=COLORTERM=truecolor # force truecolor for emacsclient -nw Restart=on-failure RestartSec=5s StartLimitIntervalSec=30 StartLimitBurst=10 [Install] WantedBy=default.target