Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

themes/ht: Added ht theme #584

Merged
merged 4 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions themes/THEMES.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@

[![](hawaii50/hawaii50-dark.png)](hawaii50/hawaii50-dark.png)

## `ht`

[![](ht/ht-dark.png)](ht/ht-dark.png)

## `iterate`

[![](iterate/iterate-dark.png)](iterate/iterate-dark.png)
Expand Down
Binary file added themes/ht/ht-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 82 additions & 0 deletions themes/ht/ht.theme.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#! bash oh-my-bash.module

# Harrison's Theme (ht)

# Description:
# Simple prompt that shows basic working directory and exit code info
# Works with 8 color terminals

# Example prompt:
# ● [harrison@ubN2] in src ± |dev ✗|

# OMB SCM Prompt overrides
SCM_GIT_SHOW_MINIMAL_INFO="true"
SCM_THEME_PROMPT_DIRTY=" ${_omb_prompt_red}✗${_omb_prompt_normal}"
SCM_THEME_PROMPT_CLEAN=" ${_omb_prompt_green}✓${_omb_prompt_normal}"
SCM_NONE_CHAR=""

function _omb_theme_ht_exit_color {
case $1 in
0)
echo "$_omb_prompt_green"
;;
1)
echo "$_omb_prompt_red"
;;
2)
echo "$_omb_prompt_gray"
;;
126)
echo "$_omb_prompt_cyan"
;;
127)
echo "$_omb_prompt_magenta"
;;
130)
echo "$_omb_prompt_black"
;;
148)
echo "$_omb_prompt_yellow"
;;
*)
echo "$_omb_prompt_blue"
;;
esac
}

# Displays the current prompt
function _omb_theme_PROMPT_COMMAND {
# Capture exit code
# NOTE: DO NOT MOVE
local EXIT_CODE=$?

# Start prompt blank
PS1=""

# Exit code indicator
PS1+="$(_omb_theme_ht_exit_color "$EXIT_CODE")●$_omb_prompt_reset_color"

# Environment info
PS1+="$_omb_prompt_red$(_omb_prompt_get_ruby_env)$_omb_prompt_reset_color"
PS1+="$_omb_prompt_green$(_omb_prompt_get_python_env)$_omb_prompt_reset_color"

# User and host
local user_host_prefix=" $_omb_prompt_reset_color["
local user_host_suffix="$_omb_prompt_reset_color]"
local user="$_omb_prompt_blue\u"
local host="$_omb_prompt_cyan\H"
local at="$_omb_prompt_reset_color@"
PS1+="$user_host_prefix$user$at$host$user_host_suffix"

# Working directory
PS1+=" in $_omb_prompt_magenta\W$_omb_prompt_reset_color"

# SCM
PS1+=" $(scm_prompt_char_info)"

# End prompt
PS1+="\n${_omb_prompt_green}➜ $_omb_prompt_normal"
}

# Runs prompt (this bypasses oh-my-bash $PROMPT setting)
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
Loading