dot

packages and services management
Log | Files | Refs | README

commit 428d4e8cc861c576f5ad7313033ae0ee127e25d9
parent 3f1fdcc17d3fba9454f53945b09c3b10dd97cef4
Author: josuah <mail@josuah.net>
Date:   Fri, 16 Dec 2016 17:09:59 +0000

Much much simpler prompt

Diffstat:
M.local/share/build/iomenu | 2+-
M.profile | 25++++++++++++++++++++++---
2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/.local/share/build/iomenu b/.local/share/build/iomenu @@ -1,3 +1,3 @@ # Input/Output interactive menu and completion engine. -tar=http://repo.or.cz/iomenu.git/snapshot/c4ff9734cd2ed5794dd2e2f133e59db18e34f1d9.tar.gz +tar=http://repo.or.cz/iomenu.git/snapshot/2abc152e13a1a9eb42c45587a4a3a797a7b36ac0.tar.gz diff --git a/.profile b/.profile @@ -44,10 +44,24 @@ export PS1='$( # cursor shape printf "\033[?6c" - # status + cd "$1" + printf "\n" - status path "$PWD" - printf "\n\033[1;30m>\033[0;3%sm>\033[1m>\033[m " "$color" + + # current path with "$HOME" replaced with '~' + [ -z "${PWD##$HOME*}" ] && printf ~%s "${PWD#$HOME}" || printf %s "$PWD" + + # git branch + if git rev-parse 2> /dev/null + then + git -c color.status=always status -sb + else + printf "\n" + fi + + # prompt character + status_path "$PWD" + printf "\033[1;30m>\033[0;3%sm>\033[1m>\033[m " "$color" )' export PS2=' > ' export PS3=' > ' @@ -84,6 +98,11 @@ alias lines='find . -name "*.[ch]" | xargs wc -l' #_______________________________________________________________________________ +status_path() +{ +} + + color() { for i in 1 2 3 4 5 6 7