Emacs background autostart sudo daemon: Difference between revisions

From 清冽之泉
Jump to navigation Jump to search
Created page with "<syntaxhighlight lang="bash"> sudo touch /etc/systemd/system/emacs.service sudo chmod 664 /etc/systemd/system/emacs.service </syntaxhighlight> <syntaxhighlight lang="bash"> [Unit] Description=Emacs: the extensible, self-documenting text editor [Service] Type=forking ExecStart=/usr/bin/emacs --daemon ExecStop=/usr/bin/emacsclient --eval "(kill-emacs)" Environment=SSH_AUTH_SOCK=%t/keyring/ssh Restart=always [Install] WantedBy=multi-user.target </syntaxhighlight> <syntaxh..."
 
No edit summary
 
Line 1: Line 1:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sudo touch /etc/systemd/system/emacs.service
sudo touch /etc/systemd/system/emacs-sudo.service
sudo chmod 664 /etc/systemd/system/emacs.service
sudo chmod 664 /etc/systemd/system/emacs-sudo.service
</syntaxhighlight>
</syntaxhighlight>



Latest revision as of 11:30, 14 May 2025

sudo touch /etc/systemd/system/emacs-sudo.service
sudo chmod 664 /etc/systemd/system/emacs-sudo.service
[Unit]
Description=Emacs: the extensible, self-documenting text editor
[Service]
Type=forking
ExecStart=/usr/bin/emacs --daemon
ExecStop=/usr/bin/emacsclient --eval "(kill-emacs)"
Environment=SSH_AUTH_SOCK=%t/keyring/ssh
Restart=always
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable emacs.service
sudo systemctl start emacs.service