aboutsummaryrefslogtreecommitdiff
path: root/bin/menu-projects
diff options
context:
space:
mode:
authorSamuel Fadel <samuel@nihil.ws>2023-02-23 11:49:55 +0100
committerSamuel Fadel <samuel@nihil.ws>2023-02-23 11:49:55 +0100
commitb396d0eae7fabc5e8f9b20f469e07b629b00dca1 (patch)
treefee799dcbae191ce834e3c306b9dce4a74d6f0bc /bin/menu-projects
parent5f3200afd34b1b0ac0a809f3270e1117659957e5 (diff)
Added new utility to launch projects.
* bin/menu-projects: Launches an instance of Emacs (possibly with guix shell) withing the directory of projects in ~/src
Diffstat (limited to 'bin/menu-projects')
-rwxr-xr-xbin/menu-projects16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/menu-projects b/bin/menu-projects
new file mode 100755
index 0000000..6d529f5
--- /dev/null
+++ b/bin/menu-projects
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# Looks only for directories with a git repo attached to it
+project=$({ for p in $HOME/src/*/.git ;do
+ basename `dirname $p`
+ done } | bemenu -i -s -c -l 20 -W 0.5 -p 'Project:')
+
+# cd into the project directory to load manifests, if available, and start Emacs from there
+cd $HOME/src/$project
+if [ -f manifest.scm ]; then
+ guix shell -m manifest.scm -- emacs .
+elif [ -f .manifest.scm ]; then
+ guix shell -m .manifest.scm -- emacs .
+else
+ emacs .
+fi