Skip to content

Instantly share code, notes, and snippets.

@jdelacueva
Created December 2, 2021 12:34
Show Gist options
  • Save jdelacueva/4b51a1b9ae56926453b488732010026d to your computer and use it in GitHub Desktop.
Save jdelacueva/4b51a1b9ae56926453b488732010026d to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
canonical="$HOME/.emacs.d"
doom="$HOME/.doom.emacs.d"
vanilla="$HOME/.clean.emacs.d"
production="$HOME/.production.emacs.d"
simple="$HOME/.simple.emacs.d"
echo "----------------------------------------"
echo "This is .emacs.d/ present configuration:"
ls -gG .emacs.d
echo "----------------------------------------"
echo "Choose one option:
[1] $doom
[2] $vanilla
[3] $production
[4] $simple
"
read name
if [ $name -eq 1 ];
then
option=$doom
elif
[ $name -eq 2 ];
then
option=$vanilla
elif
[ $name -eq 3 ];
then
option=$production
elif
[ $name -eq 4 ];
then
option=$simple
else
echo "----------------------------------------"
echo "You did not use a valid option"
echo "Not touching configuration"
echo "Your .emacs.d symlink points to:"
ls -gG .emacs.d
echo "----------------------------------------"
exit
fi
function link_name {
if [ -e $canonical ] ;
then
rm $canonical
fi
ln -s "$(readlink -e "$option")" "$canonical"
}
link_name
echo "----------------------------------------"
echo "You have chosen $option"
echo "Your new .emacs.d symlink points to:"
ls -gG .emacs.d
echo "----------------------------------------"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment