Add a copy of the emacs user service

This commit is contained in:
Anthony Rose 2020-03-08 22:09:14 +00:00
parent b180a4760f
commit d75a340aef
2 changed files with 18 additions and 10 deletions

View file

@ -0,0 +1,17 @@
## If your Emacs is installed in a non-standard location, you may need
## to copy this file to a standard directory, eg ~/.config/systemd/user/ .
## If you install this file by hand, change the "Exec" lines below
## to use absolute file names for the executables.
[Unit]
Description=Emacs text editor
Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/
[Service]
Type=simple
ExecStart=emacs --fg-daemon
ExecStop=emacsclient --eval "(kill-emacs)"
Environment=SSH_AUTH_SOCK=%t/keyring/ssh
Restart=on-failure
[Install]
WantedBy=default.target

View file

@ -3,20 +3,11 @@
git:
repo: https://code.acperkins.com/acp/emacs.d.git
dest: "{{ ansible_env.HOME }}/.emacs.d"
- name: Find Emacs service definition
find:
paths: /usr/share/emacs
patterns: 'emacs.service'
recurse: yes
depth: 3
register: emacs_service_files
when: ansible_system == 'Linux'
- name: Create Emacs user service (Linux)
copy:
src: '{{ item.path }}'
src: emacs.service
dest: "{{ ansible_env.HOME }}/.config/systemd/user/emacs.service"
remote_src: yes
loop: '{{ emacs_service_files.files }}'
when: ansible_system == 'Linux'
- name: Add Emacs server to autostart (FreeBSD)
copy: