Created
June 30, 2016 13:10
-
-
Save draganmarjanovic/52cf2c43dcb42e25b78c4f31b564ca0d to your computer and use it in GitHub Desktop.
swaq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Colours | |
maincolour="%{$fg_bold[white]%}" | |
altcolour="%{$fg[green]%}" | |
gitcolour="%{$fg[yellow]%}" | |
resetcolour="%{$reset_color%}" | |
usercolour="" #"%{fg[blue]%}" | |
hostcolour="%{$fg[blue]%}" | |
function prompt_hostname() | |
{ | |
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then | |
echo "$maincolour [$hostcolour%n@%m$maincolour]" | |
fi | |
} | |
function precmd() # Uses: setting user/root PROMPT1 variable and rehashing commands list | |
{ | |
# Last command status | |
cmdstatus=$? | |
fail=`[ "$cmdstatus" != "0" ] && echo "%{$fg_bold[red]%} *"` | |
export PROMPT="$hostcolour# $USER$maincolour at $altcolour$HOST$maincolour in $gitcolour%~$maincolour [%*] | |
$maincolour→ $resetcolour$usercolour" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment