Skip to content

Instantly share code, notes, and snippets.

@marsam
Last active December 21, 2015 15:58
Show Gist options
  • Select an option

  • Save marsam/6330010 to your computer and use it in GitHub Desktop.

Select an option

Save marsam/6330010 to your computer and use it in GitHub Desktop.
emacs-daemon systemctl unit

Emacs daemon

emacs-daemon systemctl unit

$ systemctl enable emacs@<username>
$ systemctl start emacs@<username>

And Update /usr/share/applications/emacs.desktop with:

Exec=emacsclient -c
[Unit]
Description=Emacs: the extensible, self-documenting text editor
[Service]
Type=forking
ExecStart=/usr/bin/emacs --daemon --user %u
ExecStop=/usr/bin/emacsclient --eval "(progn (setq kill-emacs-hook 'nil) (kill-emacs))"
Restart=always
User=%i
WorkingDirectory=%h
[Install]
WantedBy=multi-user.target
# Maintainer: Mario Rodas <rodasmario2@gmail.com>
pkgname=emacs-daemon
pkgver=0.1
pkgrel=1
pkgdesc=""
arch=('any')
url="http://www.emacswiki.org/emacs/EmacsAsDaemon"
license=('APACHE')
depends=('emacs')
makedepends=()
conflicts=()
options=()
provides=()
source=('emacs.service')
sha256sums=('bb35fc19a2e02230b4f65b3c687ab24918e002aadbf46978d7cb0460d12797c4')
sha256sums=('SKIP')
package() {
install -D -m644 "${srcdir}/emacs.service" "${pkgdir}/usr/lib/systemd/system/emacs@.service"
}
# vim: ft=sh syn=sh et
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment