summaryrefslogtreecommitdiff
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
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
-rwxr-xr-xassets/emacsd30
-rw-r--r--dotfiles/system/.config/sway/config6
-rwxr-xr-xuser_scripts/applications.sh32
-rw-r--r--user_scripts/emacs_install_config.sh43
4 files changed, 80 insertions, 31 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"
+
diff --git a/dotfiles/system/.config/sway/config b/dotfiles/system/.config/sway/config
index 9e19afb..6d7efd7 100644
--- a/dotfiles/system/.config/sway/config
+++ b/dotfiles/system/.config/sway/config
@@ -72,7 +72,7 @@ output eDP-1 scale 1.8
#### Application Bindings
####
bindsym $mod+Shift+Return exec $term
- bindsym $mod+e exec emacs
+ bindsym $mod+e exec emacsclient -c -a ""
bindsym $mod+w exec $browser
bindsym $mod+f exec thunar
bindsym $mod+b exec calibre
@@ -155,8 +155,8 @@ output eDP-1 scale 1.8
# You can "split" the current object of your focus with
# $mod+b or $mod+v, for horizontal and vertical splits
# respectively.
- bindsym $mod+b splith
- bindsym $mod+v splitv
+ bindsym $mod+Shift+b splith
+ bindsym $mod++Shift+v splitv
# Switch the current container between different layout styles
bindsym $mod+Shift+m layout stacking # (monacle-view)
diff --git a/user_scripts/applications.sh b/user_scripts/applications.sh
index 86b89b6..b137b46 100755
--- a/user_scripts/applications.sh
+++ b/user_scripts/applications.sh
@@ -8,32 +8,6 @@ then
echo "Must run as user. Exiting."
exit
fi
-
- #### Emacs and Dependencies
-sudo pkg install -y emacs # everything is ultimately to run or assist Emacs
-sudo pkg install -y ImageMagick7 # image processing
-sudo pkg install -y aspell # spell checker
-sudo pkg install -y en-aspell # english dictionary
-sudo pkg install -y fd-find # faster find alternative
-sudo pkg install -y ffmpegthumbnailer # video thumbnailer
-sudo pkg install -y gnutls # gnu transport layer security
-sudo pkg install -y gtar # gnu version of tar
-sudo pkg install -y isync # manage local copy of remote IMAP folders
-sudo pkg install -y mediainfo # tag information for video and audio files
-sudo pkg install -y mpv # video player
-sudo pkg install -y mu # mail searching front-end (used with isync)
-sudo pkg install -y multimarkdown # markdown processor
-sudo pkg install -y pkgconf # configure compiler and linker flags
-sudo pkg install -y png # manipulate png files
-sudo pkg install -y poppler # pdf rendering library
-sudo pkg install -y poppler-glib # glib bindings for poppler
-sudo pkg install -y sdcv # utility to work with dictionaries in StarDict's format
-
- #### Miscellaneous
-sudo pkg install -y calibre # ebook management application
-sudo pkg install -y neofetch # system info script
-sudo pkg install -y py311-ranger # file manager with VI key bindings
-
#### Developer Tools
sudo pkg install -y autoconf # generate gnu configure scripts
sudo pkg install -y autotools # gnu autotools meta-port
@@ -59,13 +33,15 @@ sudo pkg install -y gnupg # free pgp implementation
sudo pkg install -y gpgme # library to make gnupg easier
#### Utilities
-sudo pkg install -y ncdu # disk space analysis and cleanup
-sudo pkg install -y htop # process analysis
sudo pkg install -y gotop # process and system analysis
+sudo pkg install -y htop # process analysis
+sudo pkg install -y ncdu # disk space analysis and cleanup
+sudo pkg install -y neofetch # system info script
sudo pkg install -y nsxiv # image viewer
sudo pkg install -y py311-ranger # terminal file manager
#### Desktop Applications
+sudo pkg install -y calibre # ebook management application
sudo pkg install -y firefox # web browser
sudo pkg install -y zathura # lightweight pdf viewer
sudo pkg install -y zathura-cb # zathura comic book plugin
diff --git a/user_scripts/emacs_install_config.sh b/user_scripts/emacs_install_config.sh
new file mode 100644
index 0000000..9e2abf1
--- /dev/null
+++ b/user_scripts/emacs_install_config.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+# Craig Jennings <c@cjennings.net>
+# Emacs Install and Config
+
+# ensure user
+if [ $(id -u) -eq 0 ]
+then
+ echo "Must run as user. Exiting."
+ exit
+fi
+
+# Install emacs and all dependencies
+sudo pkg install -y emacs # everything is ultimately to run or assist Emacs
+sudo pkg install -y ImageMagick7 # image processing
+sudo pkg install -y aspell # spell checker
+sudo pkg install -y en-aspell # english dictionary
+sudo pkg install -y fd-find # faster find alternative
+sudo pkg install -y ffmpegthumbnailer # video thumbnailer
+sudo pkg install -y gnutls # gnu transport layer security
+sudo pkg install -y gtar # gnu version of tar
+sudo pkg install -y isync # manage local copy of remote IMAP folders
+sudo pkg install -y mediainfo # tag information for video and audio files
+sudo pkg install -y mpv # video player
+sudo pkg install -y mu # mail searching front-end (used with isync)
+sudo pkg install -y multimarkdown # markdown processor
+sudo pkg install -y pkgconf # configure compiler and linker flags
+sudo pkg install -y png # manipulate png files
+sudo pkg install -y poppler # pdf rendering library
+sudo pkg install -y poppler-glib # glib bindings for poppler
+sudo pkg install -y sdcv # utility to work with dictionaries in StarDict's format
+pkg install -y coreutils # emacs requires FSF's version of ls
+
+# install via https
+git clone --depth 1 git@cjennings.net:dotemacs.git ~/.emacs.d/
+
+# change remote to git url
+cd ~/.emacs.d/
+git remote remove origin
+git remote add origin git@cjennings.net:dotemacs.git
+
+# add the emacsd rc.d service
+sudo cp ../assets/emacsd /usr/local/etc/rc.d/emacsd
+sysrc emacsd_enable="YES"