summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/getprojects6
-rwxr-xr-xscripts/killemacs5
-rwxr-xr-xscripts/launchemacs5
-rwxr-xr-xscripts/newemacs14
-rwxr-xr-xscripts/restartemacs2
-rwxr-xr-xscripts/startup2
6 files changed, 32 insertions, 2 deletions
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