Last active
August 7, 2021 07:23
-
-
Save paudirac/6924b16c340ed8aae3eab0a4912b9cb1 to your computer and use it in GitHub Desktop.
Select from multiples emacs.d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function show_options { | |
readlink $(find $HOME -maxdepth 1 -type l -iname '.*emacs.d') \ | |
| awk 'sub(/\.d\//,"",$0) { print "Current emacs is \t\t" substr($0,2) }' | |
echo | |
echo "Call with following options to change:" | |
find $HOME/emacs -maxdepth 1 -mindepth 1 -type d -printf "\t%f\n" | |
} | |
function switch_emacs { | |
rm -rf .emacs.d # if exists | |
ln -s $HOME/emacs/$1 .emacs.d | |
echo "Emacs set to $1" | |
} | |
cd $HOME | |
if [ -z "$1" ] | |
then | |
show_options | |
else | |
switch_emacs $1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment