Last active
September 21, 2017 14:58
-
-
Save jmurowaniecki/8e48fa4bd605d5974980d8fc4031a207 to your computer and use it in GitHub Desktop.
Meu terminal
This file contains 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
#!/usr/sbin/env bash | |
function git-branch-name | |
{ | |
branch=$(git symbolic-ref HEAD 2>/dev/null | awk -F/ {'print $NF'}) | |
dirty=1 | |
[[ "${branch}" == "" ]] && return | |
[[ "$(git status 2> /dev/null | grep 'nothing to commit')" != "" ]] && \ | |
dirty=0 | |
cols=$(expr $COLUMNS - ${#branch} - 5) | |
echo -en "\e[0;45m ⎇ \e[${dirty};45m ${branch} \e[0;0m" | |
} | |
PS1='${debian_chroot:+($debian_chroot)}\[$(git-branch-name)\]\[\e[0m\]\e[m 🗲 \u\[\e[0m\]\[\e[2m in \e[0m\]\[\e[0;1m\]\w\[\e[0m\]/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
+1