summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-05-10 13:32:51 -0500
committerCraig Jennings <c@cjennings.net>2025-05-10 13:32:51 -0500
commit8337f168b397685955aa9535cbc448cc98c20694 (patch)
tree4d7c08493ca71261dba2f9db73d30d61a5e6792c /assets
parentf9f395efab5184ae432fd5b25b3b58af24cde590 (diff)
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
Diffstat (limited to 'assets')
-rwxr-xr-xassets/emacsd30
1 files changed, 30 insertions, 0 deletions
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 <c@cjennings.net>
+# 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"
+