The discussion about emacs startup times quickly come to an end once you run an Emacs daemon as a service. On Debian Linux this is possible in user space using a service definition file in ~/.config/systemd/user/. Beeing not an expert Linux admin I had to google around a little bit and somehow find this lines:
[Unit]
Description=Start emacs bg daemon
After=graphical-session.target
PartOf=graphical-session.target
[Service]
Type=exec
ExecStart=/usr/bin/emacs --fg-daemon
[Install]
WantedBy=graphical-session.target
Combining this service with a handy system wide keyboard shortcut for opening an emacs frame gives a nice way of using Emacs. I bind win-e to this little shell snippet, so that i can quickly open a new emacs frame.
#!/bin/sh
emacsclient -n -q -c $1
The tool to control the emacs daemon service is called systemctl. The tool to access the logfiles is journalctl. Beeing no expert Linux admin, this is to many tools for my hippocampus. So I wrapped it into a short shell script. That way I can quickly access start, stop, status functionality. It also saves me some typing…
#!/usr/bin/sh
usage() {
printf "―――――――――――――――――――――――――――――――――――――――――――――――――――\n"
printf "| Usage: emctl start|stop|restart|log|edit|status |\n"
printf "―――――――――――――――――――――――――――――――――――――――――――――――――――\n"
exit 1
}
if [ "$#" != 1 ] ; then
usage
fi
command=$1
case "$command" in
start|stop|restart|status)
systemctl --user $command emacs.service
;;
log)
journalctl --user -u emacs.service
;;
edit)
ec ~/.config/systemd/user/emacs.service
;;
help)
usage
;;
*)
usage
;;
esac
Having had some free time recently I co-developed (=vibe-coded) a small tool that shows up in the gnome ui status area (via a library called ayatana-appindicator). This tool informs me about the current status of the emacs daemon service (enabled/active/failure). Very unpolished code can be found here. The process involved a rough dialog with google gemini that involved a rough description of what i want (using debian linux, there is there on the top of the screen, there’s small icons, i’d like to have one of thos…) and no clue about how to achieve this. I could quickly install necessary packages, copy & paste some python scripts into my system and adjust system settings to allow the new application to show up next to the other app indicators. After refining a little bit with human intelligence I had a first running script available. Not knowing a thing about this app indicator libary or GTK (the toolkit that is used) I guess the first iteration is indeed a good starting point for further explorations.
Gib den ersten Kommentar ab