From 2e90f1fd4461fa33d7a92ca29e39c9874ce401bf Mon Sep 17 00:00:00 2001 From: Toan Nguyen Date: Fri, 24 Dec 2021 11:26:10 +0700 Subject: [PATCH] refactor: Rename "OSH => OMB" --- README.md | 12 +-- lib/cli.bash | 10 +- lib/functions.bash | 4 +- lib/git.bash | 70 +++++++------- lib/nvm.bash | 2 +- lib/spectrum.bash | 6 +- oh-my-bash.sh | 92 +++++++++---------- templates/bashrc.osh-template | 14 +-- themes/brainy/brainy.theme.bash | 2 +- themes/demula/demula.theme.bash | 2 +- .../doubletime_multiline.theme.bash | 2 +- .../doubletime_multiline_pyonly.theme.bash | 2 +- .../powerline-multiline.base.bash | 2 +- .../powerline-multiline.theme.bash | 2 +- .../powerline-naked/powerline-naked.base.bash | 2 +- .../powerline-naked.theme.bash | 2 +- .../powerline-plain/powerline-plain.base.bash | 2 +- .../powerline-plain.theme.bash | 2 +- themes/powerline/powerline.theme.bash | 2 +- themes/rana/rana.theme.bash | 2 +- tools/check_for_upgrade.bash | 10 +- tools/install.bash | 16 ++-- tools/upgrade.bash | 2 +- 23 files changed, 131 insertions(+), 131 deletions(-) diff --git a/README.md b/README.md index 56d3ab047..9626a95e9 100644 --- a/README.md +++ b/README.md @@ -65,13 +65,13 @@ _Powerline's theme is the default one. It's not the fanciest one. It's not the s Once you find a theme that you want to use, you will need to edit the `~/.bashrc` file. You'll see an environment variable (all caps) in there that looks like: ```shell -OSH_THEME="powerline" +OMB_THEME="powerline" ``` To use a different theme, simply change the value to match the name of your desired theme. For example: ```shell -OSH_THEME="agnoster" # (this is one of the fancy ones) +OMB_THEME="agnoster" # (this is one of the fancy ones) # you might need to install a special Powerline font on your console's host for this to work # see https://github.com/ohmybash/oh-my-bash/wiki/Themes#agnoster ``` @@ -86,7 +86,7 @@ If you're feeling feisty, you can let the computer select one randomly for you e ```shell -OSH_THEME="random" # (...please let it be pie... please be some pie..) +OMB_THEME="random" # (...please let it be pie... please be some pie..) ``` ## Advanced Topics @@ -101,10 +101,10 @@ Some users may want to change the default path, or manually install Oh My Bash. The default location is `~/.oh-my-bash` (hidden in your home directory) -If you'd like to change the install directory with the `OSH` environment variable, either by running `export OSH=/your/path` before installing, or by setting it before the end of the install pipeline like this: +If you'd like to change the install directory with the `OMB` environment variable, either by running `export OMB=/your/path` before installing, or by setting it before the end of the install pipeline like this: ```shell -export OSH="$HOME/.dotfiles/oh-my-bash"; sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.bash)" +export OMB="$HOME/.dotfiles/oh-my-bash"; sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.bash)" ``` #### Manual Installation @@ -144,7 +144,7 @@ Once you open up a new terminal window, it should load sh with Oh My Bash's conf If you have any hiccups installing, here are a few common fixes. * You _might_ need to modify your `PATH` in `~/.bashrc` if you're not able to find some commands after switching to `oh-my-bash`. -* If you installed manually or changed the install location, check the `OSH` environment variable in `~/.bashrc`. +* If you installed manually or changed the install location, check the `OMB` environment variable in `~/.bashrc`. ### Custom Plugins and Themes diff --git a/lib/cli.bash b/lib/cli.bash index f894d4967..090eaf733 100644 --- a/lib/cli.bash +++ b/lib/cli.bash @@ -37,7 +37,7 @@ function _omb { elif (( CURRENT == 3 )); then case "$words[2]" in changelog) local -a refs - refs=("${(@f)$(cd "$OSH"; command git for-each-ref --format="%(refname:short):%(subject)" refs/heads refs/tags)}") + refs=("${(@f)$(cd "$OMB"; command git for-each-ref --format="%(refname:short):%(subject)" refs/heads refs/tags)}") _describe 'command' refs ;; plugin) subcmds=( 'disable:Disable plugin(s)' @@ -61,7 +61,7 @@ function _omb { # if command is "disable", only offer already enabled plugins valid_plugins=($plugins) else - valid_plugins=("$OSH"/plugins/*/{_*,*.plugin.zsh}(.N:h:t) "$OSH_CUSTOM"/plugins/*/{_*,*.plugin.zsh}(.N:h:t)) + valid_plugins=("$OMB"/plugins/*/{_*,*.plugin.zsh}(.N:h:t) "$OMB_CUSTOM"/plugins/*/{_*,*.plugin.zsh}(.N:h:t)) # if command is "enable", remove already enabled plugins [[ "${words[3]}" = enable ]] && valid_plugins=(${valid_plugins:|plugins}) fi @@ -69,11 +69,11 @@ function _omb { _describe 'plugin' valid_plugins ;; plugin::info) local -aU plugins - plugins=("$OSH"/plugins/*/{_*,*.plugin.zsh}(.N:h:t) "$OSH_CUSTOM"/plugins/*/{_*,*.plugin.zsh}(.N:h:t)) + plugins=("$OMB"/plugins/*/{_*,*.plugin.zsh}(.N:h:t) "$OMB_CUSTOM"/plugins/*/{_*,*.plugin.zsh}(.N:h:t)) _describe 'plugin' plugins ;; theme::(set|use)) local -aU themes - themes=("$OSH"/themes/*.zsh-theme(.N:t:r) "$OSH_CUSTOM"/**/*.zsh-theme(.N:r:gs:"$OSH_CUSTOM"/themes/:::gs:"$OSH_CUSTOM"/:::)) + themes=("$OMB"/themes/*.zsh-theme(.N:t:r) "$OMB_CUSTOM"/**/*.zsh-theme(.N:r:gs:"$OMB_CUSTOM"/themes/:::gs:"$OMB_CUSTOM"/:::)) _describe 'theme' themes ;; esac elif (( CURRENT > 4 )); then @@ -85,7 +85,7 @@ function _omb { # if command is "disable", only offer already enabled plugins valid_plugins=($plugins) else - valid_plugins=("$OSH"/plugins/*/{_*,*.plugin.zsh}(.N:h:t) "$OSH_CUSTOM"/plugins/*/{_*,*.plugin.zsh}(.N:h:t)) + valid_plugins=("$OMB"/plugins/*/{_*,*.plugin.zsh}(.N:h:t) "$OMB_CUSTOM"/plugins/*/{_*,*.plugin.zsh}(.N:h:t)) # if command is "enable", remove already enabled plugins [[ "${words[3]}" = enable ]] && valid_plugins=(${valid_plugins:|plugins}) fi diff --git a/lib/functions.bash b/lib/functions.bash index 9ac20ba76..15236d409 100644 --- a/lib/functions.bash +++ b/lib/functions.bash @@ -4,11 +4,11 @@ function bash_stats() { } function uninstall_oh_my_bash() { - env OSH=$OSH sh $OSH/tools/uninstall.bash + env OMB=$OMB sh $OMB/tools/uninstall.bash } function upgrade_oh_my_bash() { - env OSH=$OSH sh $OSH/tools/upgrade.bash + env OMB=$OMB sh $OMB/tools/upgrade.bash } function take() { diff --git a/lib/git.bash b/lib/git.bash index 0ff25c9dd..f666064e6 100644 --- a/lib/git.bash +++ b/lib/git.bash @@ -5,7 +5,7 @@ function git_prompt_info() { if [[ "$(command git config --get oh-my-bash.hide-status 2>/dev/null)" != "1" ]]; then ref=$(command git symbolic-ref HEAD 2> /dev/null) || \ ref=$(command git rev-parse --short HEAD 2> /dev/null) || return 0 - echo "$OSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$OSH_THEME_GIT_PROMPT_SUFFIX" + echo "$OMB_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$OMB_THEME_GIT_PROMPT_SUFFIX" fi } @@ -24,9 +24,9 @@ function parse_git_dirty() { STATUS=$(command git status "${FLAGS[@]}" 2> /dev/null | tail -n1) fi if [[ -n $STATUS ]]; then - echo "$OSH_THEME_GIT_PROMPT_DIRTY" + echo "$OMB_THEME_GIT_PROMPT_DIRTY" else - echo "$OSH_THEME_GIT_PROMPT_CLEAN" + echo "$OMB_THEME_GIT_PROMPT_CLEAN" fi } @@ -40,20 +40,20 @@ function git_remote_status() { behind=$(command git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l) if [[ $ahead -eq 0 ]] && [[ $behind -eq 0 ]]; then - git_remote_status="$OSH_THEME_GIT_PROMPT_EQUAL_REMOTE" + git_remote_status="$OMB_THEME_GIT_PROMPT_EQUAL_REMOTE" elif [[ $ahead -gt 0 ]] && [[ $behind -eq 0 ]]; then - git_remote_status="$OSH_THEME_GIT_PROMPT_AHEAD_REMOTE" - git_remote_status_detailed="$OSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$OSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}" + git_remote_status="$OMB_THEME_GIT_PROMPT_AHEAD_REMOTE" + git_remote_status_detailed="$OMB_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$OMB_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}" elif [[ $behind -gt 0 ]] && [[ $ahead -eq 0 ]]; then - git_remote_status="$OSH_THEME_GIT_PROMPT_BEHIND_REMOTE" - git_remote_status_detailed="$OSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$OSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}" + git_remote_status="$OMB_THEME_GIT_PROMPT_BEHIND_REMOTE" + git_remote_status_detailed="$OMB_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$OMB_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}" elif [[ $ahead -gt 0 ]] && [[ $behind -gt 0 ]]; then - git_remote_status="$OSH_THEME_GIT_PROMPT_DIVERGED_REMOTE" - git_remote_status_detailed="$OSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$OSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}$OSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$OSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}" + git_remote_status="$OMB_THEME_GIT_PROMPT_DIVERGED_REMOTE" + git_remote_status_detailed="$OMB_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$OMB_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}$OMB_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$OMB_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}" fi - if [[ -n $OSH_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED ]]; then - git_remote_status="$OSH_THEME_GIT_PROMPT_REMOTE_STATUS_PREFIX$remote$git_remote_status_detailed$OSH_THEME_GIT_PROMPT_REMOTE_STATUS_SUFFIX" + if [[ -n $OMB_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED ]]; then + git_remote_status="$OMB_THEME_GIT_PROMPT_REMOTE_STATUS_PREFIX$remote$git_remote_status_detailed$OMB_THEME_GIT_PROMPT_REMOTE_STATUS_SUFFIX" fi echo $git_remote_status @@ -81,7 +81,7 @@ function git_commits_ahead() { if command git rev-parse --git-dir &>/dev/null; then local commits="$(git rev-list --count @{upstream}..HEAD)" if [[ "$commits" != 0 ]]; then - echo "$OSH_THEME_GIT_COMMITS_AHEAD_PREFIX$commits$OSH_THEME_GIT_COMMITS_AHEAD_SUFFIX" + echo "$OMB_THEME_GIT_COMMITS_AHEAD_PREFIX$commits$OMB_THEME_GIT_COMMITS_AHEAD_SUFFIX" fi fi } @@ -91,7 +91,7 @@ function git_commits_behind() { if command git rev-parse --git-dir &>/dev/null; then local commits="$(git rev-list --count HEAD..@{upstream})" if [[ "$commits" != 0 ]]; then - echo "$OSH_THEME_GIT_COMMITS_BEHIND_PREFIX$commits$OSH_THEME_GIT_COMMITS_BEHIND_SUFFIX" + echo "$OMB_THEME_GIT_COMMITS_BEHIND_PREFIX$commits$OMB_THEME_GIT_COMMITS_BEHIND_SUFFIX" fi fi } @@ -99,36 +99,36 @@ function git_commits_behind() { # Outputs if current branch is ahead of remote function git_prompt_ahead() { if [[ -n "$(command git rev-list origin/$(git_current_branch)..HEAD 2> /dev/null)" ]]; then - echo "$OSH_THEME_GIT_PROMPT_AHEAD" + echo "$OMB_THEME_GIT_PROMPT_AHEAD" fi } # Outputs if current branch is behind remote function git_prompt_behind() { if [[ -n "$(command git rev-list HEAD..origin/$(git_current_branch) 2> /dev/null)" ]]; then - echo "$OSH_THEME_GIT_PROMPT_BEHIND" + echo "$OMB_THEME_GIT_PROMPT_BEHIND" fi } # Outputs if current branch exists on remote or not function git_prompt_remote() { if [[ -n "$(command git show-ref origin/$(git_current_branch) 2> /dev/null)" ]]; then - echo "$OSH_THEME_GIT_PROMPT_REMOTE_EXISTS" + echo "$OMB_THEME_GIT_PROMPT_REMOTE_EXISTS" else - echo "$OSH_THEME_GIT_PROMPT_REMOTE_MISSING" + echo "$OMB_THEME_GIT_PROMPT_REMOTE_MISSING" fi } # Formats prompt string for current git commit short SHA function git_prompt_short_sha() { local SHA - SHA=$(command git rev-parse --short HEAD 2> /dev/null) && echo "$OSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$OSH_THEME_GIT_PROMPT_SHA_AFTER" + SHA=$(command git rev-parse --short HEAD 2> /dev/null) && echo "$OMB_THEME_GIT_PROMPT_SHA_BEFORE$SHA$OMB_THEME_GIT_PROMPT_SHA_AFTER" } # Formats prompt string for current git commit long SHA function git_prompt_long_sha() { local SHA - SHA=$(command git rev-parse HEAD 2> /dev/null) && echo "$OSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$OSH_THEME_GIT_PROMPT_SHA_AFTER" + SHA=$(command git rev-parse HEAD 2> /dev/null) && echo "$OMB_THEME_GIT_PROMPT_SHA_BEFORE$SHA$OMB_THEME_GIT_PROMPT_SHA_AFTER" } # Get the status of the working tree @@ -137,44 +137,44 @@ function git_prompt_status() { INDEX=$(command git status --porcelain -b 2> /dev/null) STATUS="" if $(echo "$INDEX" | command grep -E '^\?\? ' &> /dev/null); then - STATUS="$OSH_THEME_GIT_PROMPT_UNTRACKED$STATUS" + STATUS="$OMB_THEME_GIT_PROMPT_UNTRACKED$STATUS" fi if $(echo "$INDEX" | grep '^A ' &> /dev/null); then - STATUS="$OSH_THEME_GIT_PROMPT_ADDED$STATUS" + STATUS="$OMB_THEME_GIT_PROMPT_ADDED$STATUS" elif $(echo "$INDEX" | grep '^M ' &> /dev/null); then - STATUS="$OSH_THEME_GIT_PROMPT_ADDED$STATUS" + STATUS="$OMB_THEME_GIT_PROMPT_ADDED$STATUS" fi if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then - STATUS="$OSH_THEME_GIT_PROMPT_MODIFIED$STATUS" + STATUS="$OMB_THEME_GIT_PROMPT_MODIFIED$STATUS" elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then - STATUS="$OSH_THEME_GIT_PROMPT_MODIFIED$STATUS" + STATUS="$OMB_THEME_GIT_PROMPT_MODIFIED$STATUS" elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then - STATUS="$OSH_THEME_GIT_PROMPT_MODIFIED$STATUS" + STATUS="$OMB_THEME_GIT_PROMPT_MODIFIED$STATUS" fi if $(echo "$INDEX" | grep '^R ' &> /dev/null); then - STATUS="$OSH_THEME_GIT_PROMPT_RENAMED$STATUS" + STATUS="$OMB_THEME_GIT_PROMPT_RENAMED$STATUS" fi if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then - STATUS="$OSH_THEME_GIT_PROMPT_DELETED$STATUS" + STATUS="$OMB_THEME_GIT_PROMPT_DELETED$STATUS" elif $(echo "$INDEX" | grep '^D ' &> /dev/null); then - STATUS="$OSH_THEME_GIT_PROMPT_DELETED$STATUS" + STATUS="$OMB_THEME_GIT_PROMPT_DELETED$STATUS" elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then - STATUS="$OSH_THEME_GIT_PROMPT_DELETED$STATUS" + STATUS="$OMB_THEME_GIT_PROMPT_DELETED$STATUS" fi if $(command git rev-parse --verify refs/stash >/dev/null 2>&1); then - STATUS="$OSH_THEME_GIT_PROMPT_STASHED$STATUS" + STATUS="$OMB_THEME_GIT_PROMPT_STASHED$STATUS" fi if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then - STATUS="$OSH_THEME_GIT_PROMPT_UNMERGED$STATUS" + STATUS="$OMB_THEME_GIT_PROMPT_UNMERGED$STATUS" fi if $(echo "$INDEX" | grep '^## [^ ]\+ .*ahead' &> /dev/null); then - STATUS="$OSH_THEME_GIT_PROMPT_AHEAD$STATUS" + STATUS="$OMB_THEME_GIT_PROMPT_AHEAD$STATUS" fi if $(echo "$INDEX" | grep '^## [^ ]\+ .*behind' &> /dev/null); then - STATUS="$OSH_THEME_GIT_PROMPT_BEHIND$STATUS" + STATUS="$OMB_THEME_GIT_PROMPT_BEHIND$STATUS" fi if $(echo "$INDEX" | grep '^## [^ ]\+ .*diverged' &> /dev/null); then - STATUS="$OSH_THEME_GIT_PROMPT_DIVERGED$STATUS" + STATUS="$OMB_THEME_GIT_PROMPT_DIVERGED$STATUS" fi echo $STATUS } diff --git a/lib/nvm.bash b/lib/nvm.bash index 597eff90d..f7c84404b 100644 --- a/lib/nvm.bash +++ b/lib/nvm.bash @@ -6,5 +6,5 @@ function nvm_prompt_info() { nvm_prompt=$(node -v 2>/dev/null) [[ "${nvm_prompt}x" == "x" ]] && return nvm_prompt=${nvm_prompt:1} - echo "${OSH_THEME_NVM_PROMPT_PREFIX}${nvm_prompt}${OSH_THEME_NVM_PROMPT_SUFFIX}" + echo "${OMB_THEME_NVM_PROMPT_PREFIX}${nvm_prompt}${OMB_THEME_NVM_PROMPT_SUFFIX}" } diff --git a/lib/spectrum.bash b/lib/spectrum.bash index 42f3db1a4..c6613bc8e 100644 --- a/lib/spectrum.bash +++ b/lib/spectrum.bash @@ -30,19 +30,19 @@ if [ "${BASH_VERSINFO[0]}" -gt 4 ]; then done - OSH_SPECTRUM_TEXT=${OSH_SPECTRUM_TEXT:-Arma virumque cano Troiae qui primus ab oris} + OMB_SPECTRUM_TEXT=${OMB_SPECTRUM_TEXT:-Arma virumque cano Troiae qui primus ab oris} # Show all 256 colors with color number function spectrum_ls() { for code in {000..255}; do - print -P -- "$code: %{$FG[$code]%}$OSH_SPECTRUM_TEXT%{$reset_color%}" + print -P -- "$code: %{$FG[$code]%}$OMB_SPECTRUM_TEXT%{$reset_color%}" done } # Show all 256 colors where the background is set to specific color function spectrum_bls() { for code in {000..255}; do - print -P -- "$code: %{$BG[$code]%}$OSH_SPECTRUM_TEXT%{$reset_color%}" + print -P -- "$code: %{$BG[$code]%}$OMB_SPECTRUM_TEXT%{$reset_color%}" done } fi diff --git a/oh-my-bash.sh b/oh-my-bash.sh index a38b3b103..d59b3e51a 100644 --- a/oh-my-bash.sh +++ b/oh-my-bash.sh @@ -8,30 +8,30 @@ esac # Check for updates on initial load... if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then - env OSH=$OSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT bash -f $OSH/tools/check_for_upgrade.bash + env OMB=$OMB DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT bash -f $OMB/tools/check_for_upgrade.bash fi # Initializes Oh My Bash # add a function path -fpath=($OSH/functions $fpath) +fpath=($OMB/functions $fpath) -# Set OSH_CUSTOM to the path where your custom config files +# Set OMB_CUSTOM to the path where your custom config files # and plugins exists, or else we will use the default custom/ -if [[ -z "$OSH_CUSTOM" ]]; then - OSH_CUSTOM="$OSH/custom" +if [[ -z "$OMB_CUSTOM" ]]; then + OMB_CUSTOM="$OMB/custom" fi -# Set OSH_CACHE_DIR to the path where cache files should be created +# Set OMB_CACHE_DIR to the path where cache files should be created # or else we will use the default cache/ -if [[ -z "$OSH_CACHE_DIR" ]]; then - OSH_CACHE_DIR="$OSH/cache" +if [[ -z "$OMB_CACHE_DIR" ]]; then + OMB_CACHE_DIR="$OMB/cache" fi # Load all of the config files in ~/.oh-my-bash/lib that end in .bash # TIP: Add files you don't want in git to .gitignore -for config_file in $OSH/lib/*.bash; do - custom_config_file="${OSH_CUSTOM}/lib/${config_file:t}" +for config_file in $OMB/lib/*.bash; do + custom_config_file="${OMB_CUSTOM}/lib/${config_file:t}" [ -f "${custom_config_file}" ] && config_file=${custom_config_file} source $config_file done @@ -46,10 +46,10 @@ is_plugin() { # Add all defined plugins to fpath. This must be done # before running compinit. for plugin in ${plugins[@]}; do - if is_plugin $OSH_CUSTOM $plugin; then - fpath=($OSH_CUSTOM/plugins/$plugin $fpath) - elif is_plugin $OSH $plugin; then - fpath=($OSH/plugins/$plugin $fpath) + if is_plugin $OMB_CUSTOM $plugin; then + fpath=($OMB_CUSTOM/plugins/$plugin $fpath) + elif is_plugin $OMB $plugin; then + fpath=($OMB/plugins/$plugin $fpath) fi done @@ -61,10 +61,10 @@ is_completion() { # Add all defined completions to fpath. This must be done # before running compinit. for completion in ${completions[@]}; do - if is_completion $OSH_CUSTOM $completion; then - fpath=($OSH_CUSTOM/completions/$completion $fpath) - elif is_completion $OSH $completion; then - fpath=($OSH/completions/$completion $fpath) + if is_completion $OMB_CUSTOM $completion; then + fpath=($OMB_CUSTOM/completions/$completion $fpath) + elif is_completion $OMB $completion; then + fpath=($OMB/completions/$completion $fpath) fi done @@ -76,10 +76,10 @@ is_alias() { # Add all defined completions to fpath. This must be done # before running compinit. for alias in ${aliases[@]}; do - if is_alias $OSH_CUSTOM $alias; then - fpath=($OSH_CUSTOM/aliases/$alias $fpath) - elif is_alias $OSH $alias; then - fpath=($OSH/aliases/$alias $fpath) + if is_alias $OMB_CUSTOM $alias; then + fpath=($OMB_CUSTOM/aliases/$alias $fpath) + elif is_alias $OMB $alias; then + fpath=($OMB/aliases/$alias $fpath) fi done @@ -93,33 +93,33 @@ fi # Load all of the plugins that were defined in ~/.bashrc for plugin in ${plugins[@]}; do - if [ -f $OSH_CUSTOM/plugins/$plugin/$plugin.plugin.bash ]; then - source $OSH_CUSTOM/plugins/$plugin/$plugin.plugin.bash - elif [ -f $OSH/plugins/$plugin/$plugin.plugin.bash ]; then - source $OSH/plugins/$plugin/$plugin.plugin.bash + if [ -f $OMB_CUSTOM/plugins/$plugin/$plugin.plugin.bash ]; then + source $OMB_CUSTOM/plugins/$plugin/$plugin.plugin.bash + elif [ -f $OMB/plugins/$plugin/$plugin.plugin.bash ]; then + source $OMB/plugins/$plugin/$plugin.plugin.bash fi done # Load all of the aliases that were defined in ~/.bashrc for alias in ${aliases[@]}; do - if [ -f $OSH_CUSTOM/aliases/$alias.aliases.bash ]; then - source $OSH_CUSTOM/aliases/$alias.aliases.bash - elif [ -f $OSH/aliases/$alias.aliases.bash ]; then - source $OSH/aliases/$alias.aliases.bash + if [ -f $OMB_CUSTOM/aliases/$alias.aliases.bash ]; then + source $OMB_CUSTOM/aliases/$alias.aliases.bash + elif [ -f $OMB/aliases/$alias.aliases.bash ]; then + source $OMB/aliases/$alias.aliases.bash fi done # Load all of the completions that were defined in ~/.bashrc for completion in ${completions[@]}; do - if [ -f $OSH_CUSTOM/completions/$completion.completion.bash ]; then - source $OSH_CUSTOM/completions/$completion.completion.bash - elif [ -f $OSH/completions/$completion.completion.bash ]; then - source $OSH/completions/$completion.completion.bash + if [ -f $OMB_CUSTOM/completions/$completion.completion.bash ]; then + source $OMB_CUSTOM/completions/$completion.completion.bash + elif [ -f $OMB/completions/$completion.completion.bash ]; then + source $OMB/completions/$completion.completion.bash fi done # Load all of your custom configurations from custom/ -for config_file in $OSH_CUSTOM/*.bash; do +for config_file in $OMB_CUSTOM/*.bash; do if [ -f $config_file ]; then source $config_file fi @@ -127,25 +127,25 @@ done unset config_file # Load colors first so they can be use in base theme -source "${OSH}/themes/colours.theme.bash" -source "${OSH}/themes/base.theme.bash" +source "${OMB}/themes/colours.theme.bash" +source "${OMB}/themes/base.theme.bash" # Load the theme -if [ "$OSH_THEME" = "random" ]; then - themes=($OSH/themes/*/*theme.bash) +if [ "$OMB_THEME" = "random" ]; then + themes=($OMB/themes/*/*theme.bash) N=${#themes[@]} ((N=(RANDOM%N))) RANDOM_THEME=${themes[$N]} source "$RANDOM_THEME" echo "[oh-my-bash] Random theme '$RANDOM_THEME' loaded..." else - if [ ! "$OSH_THEME" = "" ]; then - if [ -f "$OSH_CUSTOM/$OSH_THEME/$OSH_THEME.theme.bash" ]; then - source "$OSH_CUSTOM/$OSH_THEME/$OSH_THEME.theme.bash" - elif [ -f "$OSH_CUSTOM/themes/$OSH_THEME/$OSH_THEME.theme.bash" ]; then - source "$OSH_CUSTOM/themes/$OSH_THEME/$OSH_THEME.theme.bash" + if [ ! "$OMB_THEME" = "" ]; then + if [ -f "$OMB_CUSTOM/$OMB_THEME/$OMB_THEME.theme.bash" ]; then + source "$OMB_CUSTOM/$OMB_THEME/$OMB_THEME.theme.bash" + elif [ -f "$OMB_CUSTOM/themes/$OMB_THEME/$OMB_THEME.theme.bash" ]; then + source "$OMB_CUSTOM/themes/$OMB_THEME/$OMB_THEME.theme.bash" else - source "$OSH/themes/$OSH_THEME/$OSH_THEME.theme.bash" + source "$OMB/themes/$OMB_THEME/$OMB_THEME.theme.bash" fi fi fi @@ -155,7 +155,7 @@ if [[ $PROMPT ]]; then fi if ! type_exists '__git_ps1' ; then - source "$OSH/tools/git-prompt.bash" + source "$OMB/tools/git-prompt.bash" fi # Adding Support for other OSes diff --git a/templates/bashrc.osh-template b/templates/bashrc.osh-template index 21f510b56..a18019470 100644 --- a/templates/bashrc.osh-template +++ b/templates/bashrc.osh-template @@ -1,9 +1,9 @@ # Path to your oh-my-bash installation. -export OSH=$HOME/.oh-my-bash +export OMB=$HOME/.oh-my-bash # Set name of the theme to load. Optionally, if you set this to "random" # it'll load a random theme each time that oh-my-bash is loaded. -OSH_THEME="font" +OMB_THEME="font" # Uncomment the following line to use case-sensitive completion. # CASE_SENSITIVE="true" @@ -16,7 +16,7 @@ OSH_THEME="font" # DISABLE_AUTO_UPDATE="true" # Uncomment the following line to change how often to auto-update (in days). -# export UPDATE_OSH_DAYS=13 +# export UPDATE_OMB_DAYS=13 # Uncomment the following line to disable colors in ls. # DISABLE_LS_COLORS="true" @@ -40,8 +40,8 @@ OSH_THEME="font" # The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" # HIST_STAMPS="mm/dd/yyyy" -# Would you like to use another custom folder than $OSH/custom? -# OSH_CUSTOM=/path/to/new-custom-folder +# Would you like to use another custom folder than $OMB/custom? +# OMB_CUSTOM=/path/to/new-custom-folder # Which completions would you like to load? (completions can be found in ~/.oh-my-bash/completions/*) # Custom completions may be added to ~/.oh-my-bash/custom/completions/ @@ -70,7 +70,7 @@ plugins=( bashmarks ) -source $OSH/oh-my-bash.sh +source $OMB/oh-my-bash.sh # User configuration # export MANPATH="/usr/local/man:$MANPATH" @@ -93,7 +93,7 @@ source $OSH/oh-my-bash.sh # Set personal aliases, overriding those provided by oh-my-bash libs, # plugins, and themes. Aliases can be placed here, though oh-my-bash -# users are encouraged to define aliases within the OSH_CUSTOM folder. +# users are encouraged to define aliases within the OMB_CUSTOM folder. # For a full list of active aliases, run `alias`. # # Example aliases diff --git a/themes/brainy/brainy.theme.bash b/themes/brainy/brainy.theme.bash index 2fdf6110a..d48e2b6a4 100644 --- a/themes/brainy/brainy.theme.bash +++ b/themes/brainy/brainy.theme.bash @@ -152,7 +152,7 @@ ___brainy_prompt_clock() { } ___brainy_prompt_battery() { - [ ! -e $OSH/plugins/battery/battery.plugin.bash ] || + [ ! -e $OMB/plugins/battery/battery.plugin.bash ] || [ "${THEME_SHOW_BATTERY}" != "true" ] && return info=$(battery_percentage) color=$bold_green diff --git a/themes/demula/demula.theme.bash b/themes/demula/demula.theme.bash index db750040d..8b0d561ec 100644 --- a/themes/demula/demula.theme.bash +++ b/themes/demula/demula.theme.bash @@ -84,7 +84,7 @@ ${D_BRANCH_COLOR}%b %r ${D_CHANGES_COLOR}%m%u ${D_DEFAULT_COLOR}" # checks if the plugin is installed before calling battery_charge safe_battery_charge() { - if [ -e "${OSH}/plugins/battery/battery.plugin.bash" ]; + if [ -e "${OMB}/plugins/battery/battery.plugin.bash" ]; then battery_charge fi diff --git a/themes/doubletime_multiline/doubletime_multiline.theme.bash b/themes/doubletime_multiline/doubletime_multiline.theme.bash index 57aedb8f8..2042f3469 100644 --- a/themes/doubletime_multiline/doubletime_multiline.theme.bash +++ b/themes/doubletime_multiline/doubletime_multiline.theme.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source "$OSH/themes/doubletime/doubletime.theme.bash" +source "$OMB/themes/doubletime/doubletime.theme.bash" function prompt_setter() { # Save history diff --git a/themes/doubletime_multiline_pyonly/doubletime_multiline_pyonly.theme.bash b/themes/doubletime_multiline_pyonly/doubletime_multiline_pyonly.theme.bash index 2ed85bcb4..85fcd1723 100644 --- a/themes/doubletime_multiline_pyonly/doubletime_multiline_pyonly.theme.bash +++ b/themes/doubletime_multiline_pyonly/doubletime_multiline_pyonly.theme.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source "$OSH/themes/doubletime/doubletime.theme.bash" +source "$OMB/themes/doubletime/doubletime.theme.bash" function prompt_setter() { # Save history diff --git a/themes/powerline-multiline/powerline-multiline.base.bash b/themes/powerline-multiline/powerline-multiline.base.bash index c7c93f2e9..e00cff7cd 100644 --- a/themes/powerline-multiline/powerline-multiline.base.bash +++ b/themes/powerline-multiline/powerline-multiline.base.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source "$OSH/themes/powerline/powerline.base.bash" +source "$OMB/themes/powerline/powerline.base.bash" function __powerline_last_status_prompt { [[ "$1" -ne 0 ]] && echo "$(set_color ${LAST_STATUS_THEME_PROMPT_COLOR} -) ${1} ${normal}" diff --git a/themes/powerline-multiline/powerline-multiline.theme.bash b/themes/powerline-multiline/powerline-multiline.theme.bash index c9131fb9b..659747a9c 100644 --- a/themes/powerline-multiline/powerline-multiline.theme.bash +++ b/themes/powerline-multiline/powerline-multiline.theme.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source "$OSH/themes/powerline-multiline/powerline-multiline.base.bash" +source "$OMB/themes/powerline-multiline/powerline-multiline.base.bash" PROMPT_CHAR=${POWERLINE_PROMPT_CHAR:="❯"} POWERLINE_LEFT_SEPARATOR=${POWERLINE_LEFT_SEPARATOR:=""} diff --git a/themes/powerline-naked/powerline-naked.base.bash b/themes/powerline-naked/powerline-naked.base.bash index e97d287a6..dc55a6cb6 100644 --- a/themes/powerline-naked/powerline-naked.base.bash +++ b/themes/powerline-naked/powerline-naked.base.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source "$OSH/themes/powerline/powerline.base.bash" +source "$OMB/themes/powerline/powerline.base.bash" function __powerline_left_segment { local OLD_IFS="${IFS}"; IFS="|" diff --git a/themes/powerline-naked/powerline-naked.theme.bash b/themes/powerline-naked/powerline-naked.theme.bash index 8fca3a642..4c40c64a2 100644 --- a/themes/powerline-naked/powerline-naked.theme.bash +++ b/themes/powerline-naked/powerline-naked.theme.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source "$OSH/themes/powerline-naked/powerline-naked.base.bash" +source "$OMB/themes/powerline-naked/powerline-naked.base.bash" PROMPT_CHAR=${POWERLINE_PROMPT_CHAR:=""} POWERLINE_LEFT_SEPARATOR=${POWERLINE_LEFT_SEPARATOR:=""} diff --git a/themes/powerline-plain/powerline-plain.base.bash b/themes/powerline-plain/powerline-plain.base.bash index 2394f3f39..09fff5d2b 100644 --- a/themes/powerline-plain/powerline-plain.base.bash +++ b/themes/powerline-plain/powerline-plain.base.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source "$OSH/themes/powerline/powerline.base.bash" +source "$OMB/themes/powerline/powerline.base.bash" function __powerline_left_segment { local OLD_IFS="${IFS}"; IFS="|" diff --git a/themes/powerline-plain/powerline-plain.theme.bash b/themes/powerline-plain/powerline-plain.theme.bash index 369d6545f..d77ab6b25 100644 --- a/themes/powerline-plain/powerline-plain.theme.bash +++ b/themes/powerline-plain/powerline-plain.theme.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source "$OSH/themes/powerline-plain/powerline-plain.base.bash" +source "$OMB/themes/powerline-plain/powerline-plain.base.bash" USER_INFO_SSH_CHAR=${POWERLINE_USER_INFO_SSH_CHAR:="⌁ "} USER_INFO_THEME_PROMPT_COLOR=32 diff --git a/themes/powerline/powerline.theme.bash b/themes/powerline/powerline.theme.bash index 8442e0143..5929c856c 100644 --- a/themes/powerline/powerline.theme.bash +++ b/themes/powerline/powerline.theme.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source "$OSH/themes/powerline/powerline.base.bash" +source "$OMB/themes/powerline/powerline.base.bash" PROMPT_CHAR=${POWERLINE_PROMPT_CHAR:=""} POWERLINE_LEFT_SEPARATOR=${POWERLINE_LEFT_SEPARATOR:=""} diff --git a/themes/rana/rana.theme.bash b/themes/rana/rana.theme.bash index 72bbf503f..92da89ca8 100644 --- a/themes/rana/rana.theme.bash +++ b/themes/rana/rana.theme.bash @@ -117,7 +117,7 @@ ${D_BRANCH_COLOR}%b %r ${D_CHANGES_COLOR}%m%u ${D_DEFAULT_COLOR}" # checks if the plugin is installed before calling battery_charge safe_battery_charge() { - if [ -e "${OSH}/plugins/battery/battery.plugin.bash" ]; + if [ -e "${OMB}/plugins/battery/battery.plugin.bash" ]; then battery_charge fi diff --git a/tools/check_for_upgrade.bash b/tools/check_for_upgrade.bash index 16546a824..616bdeff7 100644 --- a/tools/check_for_upgrade.bash +++ b/tools/check_for_upgrade.bash @@ -11,12 +11,12 @@ function _update_osh_update() { } function _upgrade_osh() { - env BASH=$OSH sh $OSH/tools/upgrade.bash + env BASH=$OMB sh $OMB/tools/upgrade.bash # update the osh file _update_osh_update } -epoch_target=$UPDATE_OSH_DAYS +epoch_target=$UPDATE_OMB_DAYS if [[ -z "$epoch_target" ]]; then # Default to old behavior epoch_target=13 @@ -24,12 +24,12 @@ fi # Cancel upgrade if the current user doesn't have write permissions for the # oh-my-bash directory. -[[ -w "$OSH" ]] || return 0 +[[ -w "$OMB" ]] || return 0 # Cancel upgrade if git is unavailable on the system which git >/dev/null || return 0 -if mkdir "$OSH/log/update.lock" 2>/dev/null; then +if mkdir "$OMB/log/update.lock" 2>/dev/null; then if [ -f ~/.osh-update ]; then . ~/.osh-update @@ -56,5 +56,5 @@ if mkdir "$OSH/log/update.lock" 2>/dev/null; then _update_osh_update fi - rmdir $OSH/log/update.lock + rmdir $OMB/log/update.lock fi diff --git a/tools/install.bash b/tools/install.bash index 108381764..a742b3dea 100755 --- a/tools/install.bash +++ b/tools/install.bash @@ -35,13 +35,13 @@ main() { fi fi - if [ ! -n "$OSH" ]; then - OSH=$HOME/.oh-my-bash + if [ ! -n "$OMB" ]; then + OMB=$HOME/.oh-my-bash fi - if [ -d "$OSH" ]; then + if [ -d "$OMB" ]; then printf "${YELLOW}You already have Oh My Bash installed.${NORMAL}\n" - printf "You'll need to remove $OSH if you want to re-install.\n" + printf "You'll need to remove $OMB if you want to re-install.\n" exit fi @@ -65,7 +65,7 @@ main() { exit 1 fi fi - env git clone --depth=1 https://github.com/ohmybash/oh-my-bash.git $OSH || { + env git clone --depth=1 https://github.com/ohmybash/oh-my-bash.git $OMB || { printf "Error: git clone of oh-my-bash repo failed\n" exit 1 } @@ -77,9 +77,9 @@ main() { fi printf "${BLUE}Using the Oh My Bash template file and adding it to ~/.bashrc${NORMAL}\n" - cp $OSH/templates/bashrc.osh-template $HOME/.bashrc - sed "/^export OSH=/ c\\ -export OSH=$OSH + cp $OMB/templates/bashrc.osh-template $HOME/.bashrc + sed "/^export OMB=/ c\\ +export OMB=$OMB " $HOME/.bashrc > $HOME/.bashrc-ombtemp mv -f $HOME/.bashrc-ombtemp $HOME/.bashrc diff --git a/tools/upgrade.bash b/tools/upgrade.bash index 827bd8122..45a745f04 100644 --- a/tools/upgrade.bash +++ b/tools/upgrade.bash @@ -22,7 +22,7 @@ else fi printf "${BLUE}%s${NORMAL}\n" "Updating Oh My Bash" -cd "$OSH" +cd "$OMB" if git pull --rebase --stat origin master then printf '%s' "$GREEN"