From 423da31d2eef7b1f4fc6c0f5e7834606daa24c1c Mon Sep 17 00:00:00 2001 From: sherabi Date: Fri, 13 Nov 2015 17:23:13 -0500 Subject: [PATCH] New theme with new PS1 prompt --- lib/get_ip.py | 4 ++++ themes/shezaan/shezaan.theme.bash | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100755 lib/get_ip.py create mode 100644 themes/shezaan/shezaan.theme.bash diff --git a/lib/get_ip.py b/lib/get_ip.py new file mode 100755 index 00000000..0116df4f --- /dev/null +++ b/lib/get_ip.py @@ -0,0 +1,4 @@ +#!/usr/bin/env python +import socket +ip = socket.gethostbyname(socket.gethostname()) +print(ip) diff --git a/themes/shezaan/shezaan.theme.bash b/themes/shezaan/shezaan.theme.bash new file mode 100644 index 00000000..6e2425db --- /dev/null +++ b/themes/shezaan/shezaan.theme.bash @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +SCM_THEME_PROMPT_DIRTY=" ${red}✗" +SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓" +SCM_THEME_PROMPT_PREFIX=" |" +SCM_THEME_PROMPT_SUFFIX="${green}|" + +GIT_THEME_PROMPT_DIRTY=" ${red}✗" +GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓" +GIT_THEME_PROMPT_PREFIX=" ${green}|" +GIT_THEME_PROMPT_SUFFIX="${green}|" + +RVM_THEME_PROMPT_PREFIX="|" +RVM_THEME_PROMPT_SUFFIX="|" + +#myip=`ifconfig en4 | egrep "inet " | awk -F" " '{ print $2 }' | sed 's/\/[0-9]*//g'` +myip=`$BASH_IT/lib/get_ip.py` + +function prompt_command() { + PS1="${bold_cyan}\u${bold_red}@${bold_green}\H ${bold_yellow}($myip) ${bold_red}[\w] ${reset_color}\d \T\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} " +} + +PROMPT_COMMAND=prompt_command;