Update systemd service file
authorJoerg Jaspert <joerg@debian.org>
Sun, 15 Jan 2017 13:09:03 +0000 (14:09 +0100)
committerJoerg Jaspert <joerg@debian.org>
Sun, 15 Jan 2017 13:09:03 +0000 (14:09 +0100)
.config/systemd/user/emacs.service

index d69acf3..b65b820 100644 (file)
@@ -1,12 +1,22 @@
 [Unit]
 Description=Emacs: the extensible, self-documenting text editor
+PartOf=xlogin.target
+ConditionHost=|delenn
+ConditionHost=|linwsa03
+Requires=graphical-session.target
 
 [Service]
 Type=forking
+ExecStartPre=/bin/rm -f %h/.emacs.d/cache/.emacs.desktop.lock
 ExecStart=/usr/bin/emacs --daemon
-ExecStop=/usr/bin/emacsclient --eval "(kill-emacs)"
-Environment=TMPDIR=%h/tmp
-Restart=always
+ExecStop=/usr/bin/emacsclient --eval "(progn (setq kill-emacs-hook nil) (save-buffers-kill-emacs))"
+Environment=TMPDIR=/run/user/1000/tmp
+Environment=DISPLAY=:%i
+Restart=on-failure
+TimeoutStartSec=0
+SuccessExitStatus=0 1 15
 
 [Install]
 WantedBy=default.target
+WantedBy=graphical-session.target
+WantedBy=xlogin.target