-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlambda.theme.sh
More file actions
executable file
·77 lines (60 loc) · 2.32 KB
/
lambda.theme.sh
File metadata and controls
executable file
·77 lines (60 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#! bash oh-my-bash.module
# Emoji-based theme to display source control management and
# virtual environment info beside the ordinary bash prompt.
# Theme inspired by:
# - Bash_it cupcake theme
# Demo:
# ╭─ⓔ virtualenv 💁user at 💻 host in 📁directory on (🌿branch {1} ↑1 ↓1 +1 •1 ⌀1 ✗)
# ╰λ cd .bash-it/themes/lambda
# virtualenv prompts
VIRTUALENV_CHAR="ⓔ "
OMB_PROMPT_VIRTUALENV_FORMAT='%s'
OMB_PROMPT_SHOW_PYTHON_VENV=${OMB_PROMPT_SHOW_PYTHON_VENV:=true}
# SCM prompts
SCM_NONE_CHAR=""
SCM_GIT_CHAR="[±] "
SCM_GIT_BEHIND_CHAR="${_omb_prompt_brown}↓${_omb_prompt_normal}"
SCM_GIT_AHEAD_CHAR="${_omb_prompt_bold_green}↑${_omb_prompt_normal}"
SCM_GIT_UNTRACKED_CHAR="⌀"
SCM_GIT_UNSTAGED_CHAR="${_omb_prompt_bold_olive}•${_omb_prompt_normal}"
SCM_GIT_STAGED_CHAR="${_omb_prompt_bold_green}+${_omb_prompt_normal}"
SCM_THEME_PROMPT_DIRTY=""
SCM_THEME_PROMPT_CLEAN=""
SCM_THEME_PROMPT_PREFIX=""
SCM_THEME_PROMPT_SUFFIX=")"
# Git status prompts
GIT_THEME_PROMPT_DIRTY=" ${_omb_prompt_brown}✗${_omb_prompt_normal}"
GIT_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓${_omb_prompt_normal}"
GIT_THEME_PROMPT_PREFIX=""
GIT_THEME_PROMPT_SUFFIX=""
# ICONS =======================================================================
icon_start="╭─"
icon_user=" 💁 "
icon_host=" at 💻 "
icon_directory=" in 📁 "
icon_branch="🌿"
icon_end="╰λ "
# extra spaces ensure legiblity in prompt
time=" \[\e[33m\]\A"
# FUNCTIONS ===================================================================
# Rename tab
function tabname {
printf '\e]1;%s\a' "$1"
}
# Rename window
function winname {
printf '\e]2;%s\a' "$1"
}
# PROMPT OUTPUT ===============================================================
# Displays the current prompt
function _omb_theme_PROMPT_COMMAND() {
PS1=$icon_start$(_omb_prompt_print_python_venv)
PS1+=$icon_user$_omb_prompt_bold_brown'\u'
PS1+=$_omb_prompt_normal$icon_host$_omb_prompt_bold_teal'\h'$time
PS1+=$_omb_prompt_normal$icon_directory$_omb_prompt_bold_purple'\w'
PS1+=$_omb_prompt_normal$([[ -n $(_omb_prompt_git branch 2> /dev/null) ]] && _omb_util_print " on (${icon_branch} ")
PS1+=$_omb_prompt_white$(scm_prompt_info)$_omb_prompt_normal'\n'$icon_end
PS2=$icon_end
}
# Runs prompt (this bypasses oh-my-bash $PROMPT setting)
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND