Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

First commit

  • Loading branch information...
commit 2b33db3bac518312eac9d1a5cb5e217a91760e2b 0 parents
nicolargo authored
3  README.md
@@ -0,0 +1,3 @@
+# My Dotfiles
+
+For Bash, Vim...
50 _bashrc.d/bashrc_prompt
@@ -0,0 +1,50 @@
+# Colors
+NoColor="\033[0m"
+Cyan="\033[0;36m"
+Green="\033[0;32m"
+Red="\033[0;31m"
+Yellow="\033[0;33m"
+
+# Chars
+RootPrompt="#"
+NonRootPrompt="$"
+
+# Contextual prompt
+prompt() {
+ USERNAME=`whoami`
+ HOSTNAME=`hostname`
+ CURRENTPATH=`pwd`
+
+ LEFTPROMPT=$Cyan$USERNAME@$HOSTNAME":"$Yellow$CURRENTPATH
+ let LEFTSIZE=$(echo -n "$USERNAME@$HOSTNAME:$CURRENTPATH" | wc -c)
+
+ RIGHTPROMPT=""
+ let RIGHTSIZE=0
+ GITSTATUS=$(git status 2> /dev/null)
+ #echo $GITSTATUS > /dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ echo $GITSTATUS | grep "not staged" > /dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ RIGHTPROMPT=$Red
+ else
+ RIGHTPROMPT=$Green
+ fi
+ BRANCH=`git describe --contains --all HEAD`
+ RIGHTPROMPT=$RIGHTPROMPT"[Git branch "$BRANCH"]"
+ let RIGHTSIZE=$(echo -n "[Git branch "$BRANCH"]" | wc -c)
+ fi
+ let BLANCKSIZE=${COLUMNS}-${LEFTSIZE}-${RIGHTSIZE}
+ RIGHTPROMPT=$RIGHTPROMPT$NoColor
+
+ echo -e -n "\n"$LEFTPROMPT
+ printf "%$(($BLANCKSIZE))s"
+ echo -e $RIGHTPROMPT
+}
+
+# Main prompt
+PROMPT_COMMAND=prompt
+if [ $EUID -ne 0 ]; then
+ PS1=$NonRootPrompt" "
+else
+ PS1=$RootPrompt" "
+fi
26 _config/terminator/config
@@ -0,0 +1,26 @@
+[global_config]
+ title_hide_sizetext = True
+[keybindings]
+[profiles]
+ [[default]]
+ background_darkness = 0.99
+ font = Inconsolata Medium 12
+ background_color = "#002b36"
+ show_titlebar = False
+ foreground_color = "#eee8d5"
+ [[b&w]]
+ show_titlebar = False
+ cursor_color = "#599760"
+ [[tiny]]
+ use_system_font = False
+ font = Monospace 8
+ show_titlebar = False
+[layouts]
+ [[default]]
+ [[[child1]]]
+ type = Terminal
+ parent = window0
+ [[[window0]]]
+ type = Window
+ parent = ""
+[plugins]
7 bashrc
@@ -0,0 +1,7 @@
+# Defined prompt only if is not already defined
+if [ ! -z "$PS1" ]; then
+ echo "== Define the prompt"
+ source .bashrc.d/bashrc_prompt
+fi
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.