aboutsummaryrefslogtreecommitdiffstats
path: root/systemd/.config
diff options
context:
space:
mode:
authorGravatar Tom Willemse2016-07-26 15:19:32 +0200
committerGravatar Tom Willemse2016-07-26 15:19:32 +0200
commit769211e95616fecd6d81d5eabd14978f71b7c1c8 (patch)
tree59892406c0131296234493f390f46147b92f0c85 /systemd/.config
parentf1a55c3030a2c193b344db57893aaeef978b64e5 (diff)
downloadnew-dotfiles-769211e95616fecd6d81d5eabd14978f71b7c1c8.tar.gz
new-dotfiles-769211e95616fecd6d81d5eabd14978f71b7c1c8.zip
Start Emacs daemon as a systemd service
Diffstat (limited to 'systemd/.config')
-rw-r--r--systemd/.config/systemd/user/emacs.service13
-rw-r--r--systemd/.config/systemd/user/save-environment-variables@.service9
2 files changed, 22 insertions, 0 deletions
diff --git a/systemd/.config/systemd/user/emacs.service b/systemd/.config/systemd/user/emacs.service
new file mode 100644
index 0000000..9d47b67
--- /dev/null
+++ b/systemd/.config/systemd/user/emacs.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Emacs: the extensible, self-documenting text editor
+After=save-environment-variables@emacs.service
+Requires=save-environment-variables@emacs.service
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/emacs --daemon
+ExecStop=/usr/bin/emacsclient --eval "(kill-emacs)"
+Restart=always
+
+[Install]
+WantedBy=default.target
diff --git a/systemd/.config/systemd/user/save-environment-variables@.service b/systemd/.config/systemd/user/save-environment-variables@.service
new file mode 100644
index 0000000..67a03a7
--- /dev/null
+++ b/systemd/.config/systemd/user/save-environment-variables@.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Save specific environment variables
+
+[Service]
+Type=oneshot
+ExecStart=/home/chelys/usr/bin/save-environment-variables %h/.config/systemd/user/%i.service.d/env.conf PATH XDG_CONFIG_HOME XDG_DATA_HOME
+
+[Install]
+WantedBy=default.target