Skip to content

Commit

Permalink
Add support to create aliases for base24 themes
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbode committed Oct 12, 2024
1 parent 925f28e commit 1d22ec5
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions profile_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,19 @@ alias reset="command reset \
&& . $BASE16_SHELL_COLORSCHEME_PATH"

# Set base16_* aliases
for script_path in "$BASE16_SHELL_PATH"/scripts/base16*.sh; do
script_name=${script_path##*/}
script_name=${script_name%.sh}
theme_name=${script_name#base16-} # eg: solarized-light
function_name="base16_${theme_name}"

alias $function_name="set_theme \"${theme_name}\""
for n in 16 24; do
for script_path in "${BASE16_SHELL_PATH}/scripts/base${n}-"*.sh; do
script_name=${script_path##*/}
script_name=${script_name%.sh}
theme_name=${script_name#"base${n}-"} # eg: solarized-light
function_name="base${n}_${theme_name}"

alias ${function_name}="set_theme ${theme_name}"
done;
done;

# unset loop variables to not leak to user's shell
unset script_path script_name theme_name function_name
unset n script_path script_name theme_name function_name

# If $BASE16_THEME is set, this has already been loaded. This guards
# against a bug where this script is sourced two or more times.
Expand Down

0 comments on commit 1d22ec5

Please sign in to comment.