#!/bin/ksh # poor mans gitstatus # if you know a faster variant (without daemon!), lemme know gitstatus() { _path="$PWD" while [ -n "$_path" ] do [ -d "$_path/.git" ] \ && echo " ($(git branch --no-color --show-current)) " \ && break _path="${_path%/*}" done } if [ $(id -u) -eq 0 ] then PS1="${x}${RED}\${?}|\w\\$ ${RESET}${x}" else PS1="${x}${GREY}\${?}|\w\$(gitstatus)\\$ ${RESET}${x}" fi