commit 54019d944b776ca3ce6cd60a8609752f6728cfa1
parent 0d5055af7124c3325219a369e914ed2d79264360
Author: Daniel Moch <daniel@danielmoch.com>
Date: Thu, 1 Feb 2018 06:09:51 -0500
Move git-prompt.sh to .local/lib
Diffstat:
3 files changed, 1 insertion(+), 110 deletions(-)
diff --git a/.bashrc b/.bashrc
@@ -8,12 +8,10 @@ shopt -s globstar
export HISTCONTOL=erasedups
-# Git command line configuration
GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWUNTRACKEDFILES=1
-source "$HOME/.config/bash/git-prompt.sh"
+source "$HOME/.local/lib/sh/git-prompt.sh"
-# Customize the prompt
if [ x$TERM == xlinux ]
then
usercolor='\[\033[01;34m\]'
@@ -23,7 +21,6 @@ fi
export PS1=$usercolor'\u\[\033[m\]@\[\033[32m\]\h:\[\033[m\]\W\[\033[31m\]$(__git_ps1 " (%s)")\[\033[m\]\$ '
-# Configure Homebrew
if command -v brew > /dev/null 2>&1
then
export HOMEBREW_NO_ANALYTICS=1
@@ -37,12 +34,6 @@ then
fi
fi
-# $BASH_COMPLETION should contain the path to the bash_completion
-# script. If the variable is defined and is readable, it will be
-# sourced.
-#
-# NOTE: Might want to check that this isn't already sourced elsewhere
-# (e.g. /etc/profile).
[ -r "$BASH_COMPLETION" ] && source "$BASH_COMPLETION"
unset BASH_COMPLETION
diff --git a/.config/bash/truecolor_test.sh b/.config/bash/truecolor_test.sh
@@ -1,100 +0,0 @@
-#!/bin/bash
-# This file was originally taken from iterm2 https://github.com/gnachman/iTerm2/blob/master/tests/24-bit-color.sh
-#
-# This file echoes a bunch of 24-bit color codes
-# to the terminal to demonstrate its functionality.
-# The foreground escape sequence is ^[38;2;<r>;<g>;<b>m
-# The background escape sequence is ^[48;2;<r>;<g>;<b>m
-# <r> <g> <b> range from 0 to 255 inclusive.
-# The escape sequence ^[0m returns output to default
-
-setBackgroundColor()
-{
- #printf '\x1bPtmux;\x1b\x1b[48;2;%s;%s;%sm' $1 $2 $3
- printf '\x1b[48;2;%s;%s;%sm' $1 $2 $3
-}
-
-resetOutput()
-{
- echo -en "\x1b[0m\n"
-}
-
-# Gives a color $1/255 % along HSV
-# Who knows what happens when $1 is outside 0-255
-# Echoes "$red $green $blue" where
-# $red $green and $blue are integers
-# ranging between 0 and 255 inclusive
-rainbowColor()
-{
- let h=$1/43
- let f=$1-43*$h
- let t=$f*255/43
- let q=255-t
-
- if [ $h -eq 0 ]
- then
- echo "255 $t 0"
- elif [ $h -eq 1 ]
- then
- echo "$q 255 0"
- elif [ $h -eq 2 ]
- then
- echo "0 255 $t"
- elif [ $h -eq 3 ]
- then
- echo "0 $q 255"
- elif [ $h -eq 4 ]
- then
- echo "$t 0 255"
- elif [ $h -eq 5 ]
- then
- echo "255 0 $q"
- else
- # execution should never reach here
- echo "0 0 0"
- fi
-}
-
-for i in `seq 0 127`; do
- setBackgroundColor $i 0 0
- echo -en " "
-done
-resetOutput
-for i in `seq 255 -1 128`; do
- setBackgroundColor $i 0 0
- echo -en " "
-done
-resetOutput
-
-for i in `seq 0 127`; do
- setBackgroundColor 0 $i 0
- echo -n " "
-done
-resetOutput
-for i in `seq 255 -1 128`; do
- setBackgroundColor 0 $i 0
- echo -n " "
-done
-resetOutput
-
-for i in `seq 0 127`; do
- setBackgroundColor 0 0 $i
- echo -n " "
-done
-resetOutput
-for i in `seq 255 -1 128`; do
- setBackgroundColor 0 0 $i
- echo -n " "
-done
-resetOutput
-
-for i in `seq 0 127`; do
- setBackgroundColor `rainbowColor $i`
- echo -n " "
-done
-resetOutput
-for i in `seq 255 -1 128`; do
- setBackgroundColor `rainbowColor $i`
- echo -n " "
-done
-resetOutput
diff --git a/.config/bash/git-prompt.sh b/.local/lib/sh/git-prompt.sh