Skip to content

Instantly share code, notes, and snippets.

@tealtail
Created February 16, 2016 17:50
Show Gist options
  • Save tealtail/98960511519ce46d3fca to your computer and use it in GitHub Desktop.
Save tealtail/98960511519ce46d3fca to your computer and use it in GitHub Desktop.
base16-shell profile helper
#!/bin/bash
script_dir=$(cd $(dirname ${BASH_SOURCE[0]}) && pwd)
for script in $script_dir/base16*.sh; do
script_name=$(basename $script .sh)
theme=${script_name#*-}
variation=${theme#*.}
theme=${theme%.*}
cat <<FUNC
base16_${theme}_${variation}()
{
. $script
ln -fs $script ~/.base16_theme
export BASE16_THEME=base16-${theme}
export BASE16_VARIATION=$variation
if type tmux_${variation} >/dev/null; then
tmux_${variation}
fi
[ -f ~/.vimrc_background ] && rm ~/.vimrc_background
cat <<vimrc_background > ~/.vimrc_background
set background=$variation
colorscheme base16-$theme
vimrc_background
}
FUNC
done;
[ -f ~/.base16_theme ] && echo ". ~/.base16_theme"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment