From 45aca7440271522410f61c6a9abfb6b4e8589be9 Mon Sep 17 00:00:00 2001 From: Bastien Riviere Date: Fri, 28 Jun 2024 21:58:28 +0200 Subject: [PATCH] feat: add emacs daemon --- build.sh | 1 + files/usr/lib/systemd/user/emacs.service | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 files/usr/lib/systemd/user/emacs.service diff --git a/build.sh b/build.sh index 3ca6452..3436231 100755 --- a/build.sh +++ b/build.sh @@ -39,6 +39,7 @@ systemctl enable podman.socket systemctl enable tailscaled.service systemctl enable -f --global flatpak-setup.service systemctl enable -f --global azure-topgrade.service +systemctl enable -f --global emacs.service systemctl enable azure-system-setup.service systemctl enable azure-groups.service diff --git a/files/usr/lib/systemd/user/emacs.service b/files/usr/lib/systemd/user/emacs.service new file mode 100644 index 0000000..5ac18b7 --- /dev/null +++ b/files/usr/lib/systemd/user/emacs.service @@ -0,0 +1,18 @@ +[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 \ No newline at end of file