Commit b6c0530f authored by Frank Terbeck's avatar Frank Terbeck

Add a systemd unit to keep an emacs instance running at all times

parent a7362ad5
......@@ -44,6 +44,7 @@ push @emacs_dirs, $ENV{HOME} . '/.emacs.d';
my %ft_regular_globs = (
'bin/*' => '/bin',
'systemd/*' => '/.config/systemd/user',
'dict/*-mode' => '/.emacs.d/dict',
'themes/*.el' => '/.emacs.d/themes',
'vendor/*.el' => '/.emacs.d/vendor' );
......@@ -193,9 +194,17 @@ if (-f q{compile.el}) {
code => sub {
print "\n Byte-compilation disabled, run:\n";
print " % make gen-compile-el\n";
print " ...to enable.\n\n" } };
print " ...to enable.\n" }};
}
add_hook { type => 'perl',
event => 'post-deploy',
code => sub {
print "\n\nIf you are using systemd, ";
print "you may want to enable this:\n\n";
print " % systemctl --user enable emacs\n";
print " % systemctl --user start emacs\n\n" }};
unless ($method eq q{copy}) {
foreach my $d (qw{ ~/.emacs.d/vendor
~/.emacs.d/private })
......
[Unit]
Description=Emacs Operating System
Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/
[Service]
Type=notify
Restart=on-failure
Environment="PATH=%h/bin:/opt/emacs/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
ExecStart=/opt/emacs/bin/emacs --no-site-file --fg-daemon
ExecStop=/opt/emacs/bin/emacsclient --eval "(kill-emacs)"
[Install]
WantedBy=default.target
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment