Skip to content

Instantly share code, notes, and snippets.

@lanox
Created January 24, 2020 09:57
Show Gist options
  • Select an option

  • Save lanox/87008d4a9a96368079eb588fcd67b74e to your computer and use it in GitHub Desktop.

Select an option

Save lanox/87008d4a9a96368079eb588fcd67b74e to your computer and use it in GitHub Desktop.
tm-switch.sh
script_dir="$HOME/dotfiles/iterm/themes/base16"
for script in $script_dir/base16-*.sh; do
script_name="$(basename $script .sh)"
theme=${script_name#*-} # remove base16-
# variation=${theme#*.}
theme=${theme%.*}
${script_name}() {
parts=("${(@s/_/)0}") # Removed brackets around base16-atelier-estuary
theme=$parts[1] # Assignes theme name base16-atelier-estuary to theme variable.
cat $script_dir/${theme}.sh > $HOME/.base16_theme
parts=($(echo $theme | sed -E 's/.*base16-([a-z]+)(-([a-z]+))?.*/\1 \3/'))
[[ -s ~/.base16_theme ]] && . ~/.base16_theme # Shell Theme from base16
cat $HOME/dotfiles/tmux/base16-themes/$theme.conf > $HOME/.tmux_theme.conf # Sets tmux theme based on shell base16 theme
tmux source-file ~/.tmux.conf
if [[ "$theme" == "base16-gruvbox-dark-medium" ]]; then
}
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment