From b396d0eae7fabc5e8f9b20f469e07b629b00dca1 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Thu, 23 Feb 2023 11:49:55 +0100 Subject: 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 --- bin/menu-projects | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 bin/menu-projects 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 -- cgit v1.2.3