From 6f04d0e9df6270bff228f947a461fe531cc60356 Mon Sep 17 00:00:00 2001 From: Lorenzo Tucci Date: Fri, 20 Aug 2021 14:48:51 +0200 Subject: [PATCH] feat: add emacs.service for Emacs server --- emacs/emacs.service | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 emacs/emacs.service diff --git a/emacs/emacs.service b/emacs/emacs.service new file mode 100644 index 0000000..3bb60db --- /dev/null +++ b/emacs/emacs.service @@ -0,0 +1,18 @@ +# Emacs server unit service for systemd (start emacs as a server) +# This file is meant to be placed into your .config/systemd/user/ folder +# and started + enabled with systemctl enable emacs --user --now +# It is advised to add an alias for emacs to run it as client +# ex. for the terminal version: alias emacs='emacsclient -t' +[Unit] +Description=Emacs text editor +Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/ + +[Service] +Type=forking +ExecStart=/usr/bin/emacs --daemon +ExecStop=/usr/bin/emacsclient --eval "(kill-emacs)" +Environment=SSH_AUTH_SOCK=%t/keyring/ssh +Restart=on-failure + +[Install] +WantedBy=default.target