Add powerline shell prompt
This commit is contained in:
parent
c4aa98b828
commit
b8c6922e05
16
bash/.bashrc
16
bash/.bashrc
|
@ -57,11 +57,19 @@ if [ -n "$force_color_prompt" ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
if [ "$color_prompt" = yes ]; then
|
||||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\][\u@\h\[\033[00m\] \W\[\033[01;32m\]]\$\[\033[00m\]'
|
||||
else
|
||||
PS1='${debian_chroot:+($debian_chroot)}[\u@\h \W]\$ '
|
||||
function _update_ps1() {
|
||||
PS1=$(powerline-shell $?)
|
||||
}
|
||||
|
||||
if [[ $TERM != linux && ! $PROMPT_COMMAND =~ _update_ps1 ]]; then
|
||||
PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
|
||||
fi
|
||||
|
||||
" if [ "$color_prompt" = yes ]; then
|
||||
" PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\][\u@\h\[\033[00m\] \W\[\033[01;32m\]]\$\[\033[00m\]'
|
||||
" else
|
||||
" PS1='${debian_chroot:+($debian_chroot)}[\u@\h \W]\$ '
|
||||
" fi
|
||||
unset color_prompt force_color_prompt
|
||||
|
||||
# If this is an xterm set the title to user@host:dir
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"segments": [
|
||||
"virtual_env",
|
||||
"ssh",
|
||||
"cwd",
|
||||
"hg",
|
||||
"jobs",
|
||||
"root"
|
||||
],
|
||||
"theme": "~/.config/powerline-shell/kapp.py"
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
from powerline_shell.themes.default import DefaultColor
|
||||
|
||||
# 0 — black 8 — gray
|
||||
# 1 — maroon 9 — red
|
||||
# 2 — green 10 — lime
|
||||
# 3 — olive 11 — yellow
|
||||
# 4 — navy 12 — blue
|
||||
# 5 — purple 13 — fuchsia
|
||||
# 6 — teal 14 — aqua
|
||||
# 7 — silver 15 — white
|
||||
|
||||
class Color(DefaultColor):
|
||||
"""Basic theme which only uses colors in 0-15 range"""
|
||||
USERNAME_FG = 0 # black
|
||||
USERNAME_BG = 15 # white
|
||||
USERNAME_ROOT_BG = 8 # gray
|
||||
|
||||
HOSTNAME_FG = 0 # black
|
||||
HOSTNAME_BG = 2 # green
|
||||
|
||||
HOME_SPECIAL_DISPLAY = False
|
||||
PATH_BG = 8 # gray
|
||||
PATH_FG = 2 # silver
|
||||
CWD_FG = 15 # white
|
||||
SEPARATOR_FG = 2
|
||||
|
||||
READONLY_BG = 1 # maroon
|
||||
READONLY_FG = 15 # white
|
||||
|
||||
REPO_CLEAN_BG = 15 # green
|
||||
REPO_CLEAN_FG = 0 # black
|
||||
REPO_DIRTY_BG = 3 # olive
|
||||
REPO_DIRTY_FG = 15 # white
|
||||
|
||||
JOBS_FG = 15 # white
|
||||
JOBS_BG = 8 # gray
|
||||
|
||||
CMD_PASSED_BG = 2 # green
|
||||
CMD_PASSED_FG = 0 # black
|
||||
CMD_FAILED_BG = 11 # yellow
|
||||
CMD_FAILED_FG = 0 # black
|
||||
|
||||
SVN_CHANGES_BG = REPO_DIRTY_BG
|
||||
SVN_CHANGES_FG = REPO_DIRTY_FG
|
||||
|
||||
VIRTUAL_ENV_BG = 2 # green
|
||||
VIRTUAL_ENV_FG = 0 # black
|
||||
|
||||
AWS_PROFILE_FG = 14 # aqua
|
||||
AWS_PROFILE_BG = 8 # gray
|
||||
|
||||
TIME_FG = 8 # gray
|
||||
TIME_BG = 7 # silver
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit a9b8c9bb39dbfb7ec3c639e497b5a76fa6dcb8cc
|
Loading…
Reference in New Issue