From 8337f168b397685955aa9535cbc448cc98c20694 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 10 May 2025 13:32:51 -0500 Subject: get emacs working properly on bsd - add emacsd service - make sway start emacsclient rather than emacs - breakout emacs items in applications to emacs_install_config --- assets/emacsd | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 assets/emacsd (limited to 'assets') diff --git a/assets/emacsd b/assets/emacsd new file mode 100755 index 0000000..cfb3af9 --- /dev/null +++ b/assets/emacsd @@ -0,0 +1,30 @@ +#!/bin/sh +# Craig Jennings +# allows emacs client to be launched as a service + +# PROVIDE: emacsd +# REQUIRE: login # after login + +# Emacs daemon +. /etc/rc.subr + +name="emacsd" +rcvar=emacsd_enable +start_cmd="${name}_start" +stop_cmd="${name}_stop" +load_rc_config $name +: ${emacsd_enable:=no} +: ${_msg="Emacs daemon started."} +: ${emacsd_user:=cjennings} + + +emacsd_start() +{ + su ${emacsd_user} -c " /usr/local/bin/emacs --daemon -u ${emacsd_user}" +} +emacsd_stop() +{ + su ${emacsd_user} -c "/usr/local/bin/emacsclient --eval \"(kill-emacs)\"" +} +run_rc_command "$1" + -- cgit v1.2.3