From 53b5c6f41f9139c67eb347b5f7b9c35477ab6650 Mon Sep 17 00:00:00 2001 From: Jack Jamison Date: Sat, 8 Nov 2025 17:09:47 -0500 Subject: emacs scripts and vterm improvements --- scripts/getprojects | 6 ++++++ scripts/killemacs | 5 +++++ scripts/launchemacs | 5 +++++ scripts/newemacs | 14 ++++++++++++++ scripts/restartemacs | 2 +- scripts/startup | 2 +- 6 files changed, 32 insertions(+), 2 deletions(-) create mode 100755 scripts/getprojects create mode 100755 scripts/killemacs create mode 100755 scripts/launchemacs create mode 100755 scripts/newemacs (limited to 'scripts') diff --git a/scripts/getprojects b/scripts/getprojects new file mode 100755 index 0000000..c10f507 --- /dev/null +++ b/scripts/getprojects @@ -0,0 +1,6 @@ +#!/bin/sh +{ + find "$HOME/homework/" -mindepth 2 -maxdepth 2 -type d + find "$HOME/development/" -mindepth 1 -maxdepth 1 -type d + find "$HOME/opt/" -mindepth 1 -maxdepth 1 -type d +} diff --git a/scripts/killemacs b/scripts/killemacs new file mode 100755 index 0000000..1228018 --- /dev/null +++ b/scripts/killemacs @@ -0,0 +1,5 @@ +#!/bin/sh +name=$(ls -1 $XDG_RUNTIME_DIR/emacs/ | swenu -ceoil 10 -p "Kill:") +if [ $? -eq 0 ]; then + emacsclient -c -s "$name" -e '(kill-emacs)' +fi diff --git a/scripts/launchemacs b/scripts/launchemacs new file mode 100755 index 0000000..8b95242 --- /dev/null +++ b/scripts/launchemacs @@ -0,0 +1,5 @@ +#!/bin/sh +name=$(ls -1 $XDG_RUNTIME_DIR/emacs/ | swenu -ceoil 10 -p "Workspace:") +if [ $? -eq 0 ]; then + emacsclient -c -s "$name" +fi diff --git a/scripts/newemacs b/scripts/newemacs new file mode 100755 index 0000000..6b7052c --- /dev/null +++ b/scripts/newemacs @@ -0,0 +1,14 @@ +#!/bin/sh +project_name=$(swenu -coil 10 -p "New Workspace:") +if [ $? -ne 0 ]; then + exit 1 +fi + +project_path=$(getprojects | swenu -coil 10 -p "Directory:" -s "$project_name") + +emacs --daemon="$project_name" +if [ -z "$project_path" ]; then + emacsclient -c -s "$project_name" +else + emacsclient -c -s "$project_name" -e "(dired \"$project_path\")" +fi diff --git a/scripts/restartemacs b/scripts/restartemacs index 7f2cee4..5e55c81 100755 --- a/scripts/restartemacs +++ b/scripts/restartemacs @@ -1,3 +1,3 @@ #!/bin/sh pkill -x emacs -emacs --daemon +emacs --daemon=main diff --git a/scripts/startup b/scripts/startup index 31643a5..a3291e4 100755 --- a/scripts/startup +++ b/scripts/startup @@ -4,4 +4,4 @@ hypridle & waybar & pipewire & restartemacs >/dev/null & -emacs --daemon +dunst -- cgit v1.2.3