diff options
author | Samuel Fadel <samuel@nihil.ws> | 2023-02-23 11:49:55 +0100 |
---|---|---|
committer | Samuel Fadel <samuel@nihil.ws> | 2023-02-23 11:49:55 +0100 |
commit | b396d0eae7fabc5e8f9b20f469e07b629b00dca1 (patch) | |
tree | fee799dcbae191ce834e3c306b9dce4a74d6f0bc /bin | |
parent | 5f3200afd34b1b0ac0a809f3270e1117659957e5 (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')
-rwxr-xr-x | bin/menu-projects | 16 |
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 |