Compare commits
2 Commits
0840f2072f
...
3664bb3f71
Author | SHA1 | Date |
---|---|---|
Nick Chambers | 3664bb3f71 | |
Nick Chambers | ae462aa908 |
9
Makefile
9
Makefile
|
@ -1,9 +1,6 @@
|
|||
install: ~/.bash_profile ~/.bashrc
|
||||
install:
|
||||
mkdir -p ~/bin/dotlib
|
||||
cp -r dotlib/*.sh ~/bin/dotlib
|
||||
|
||||
~/.bash_profile: .bash_profile
|
||||
cp -r dotlib/* ~/bin/dotlib
|
||||
cp -f .bash_profile ~/.bash_profile
|
||||
|
||||
~/.bashrc: .bashrc
|
||||
cp -f .bashrc ~/.bashrc
|
||||
cp -f .hushlogin ~/.hushlogin
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
setup-prompt() {
|
||||
local last_res=$? color=$PS1_color_green
|
||||
local last_res=$? color=$PS1_color_success
|
||||
PS1="\w "
|
||||
|
||||
if [[ -d .git ]]; then
|
||||
|
@ -11,43 +11,16 @@ setup-prompt() {
|
|||
fi
|
||||
|
||||
if (( last_res )); then
|
||||
color=$PS1_color_red
|
||||
color=$PS1_color_fail
|
||||
fi
|
||||
|
||||
PS1+="\[$color\][$last_res]\[$PS1_color_reset\] $PS1_prompt_sym "
|
||||
}
|
||||
|
||||
PS1_prompt_sym=λ
|
||||
PS1_hostname=${HOSTNAME-"$(hostname)"}
|
||||
PS1_color_red=$(tput setaf 1)
|
||||
PS1_color_green=$(tput setaf 2)
|
||||
PS1_color_reset=$(tput sgr0)
|
||||
PROMPT_COMMAND+=(setup-prompt)
|
||||
|
||||
read -r month day < <(date "+%m %d")
|
||||
|
||||
if (( 10#$month == 3 && 10#$day < 18 )); then
|
||||
if (( 17 - 10#$day == 0 )); then
|
||||
printf "Happy Saint Patrick's day!\n"
|
||||
else
|
||||
printf "Only %d days left until Saint Patrick's day!\n" "$(( 17 - 10#$day ))"
|
||||
fi
|
||||
|
||||
PS1_prompt_sym=🍀
|
||||
elif (( 10#$month == 10 )); then
|
||||
if (( 31 - 10#$day == 0 )); then
|
||||
printf 'Have a spooky halloween!\n'
|
||||
else
|
||||
printf 'Only %d days left until Halloween!\n' "$(( 31 - 10#$day ))"
|
||||
fi
|
||||
|
||||
PS1_prompt_sym=🎃
|
||||
elif (( 10#$month == 12 && 10#$day < 26 )); then
|
||||
if (( 25 - 10#$day == 0 )); then
|
||||
printf 'Merry Christmas!\n'
|
||||
else
|
||||
printf 'Only %d days left until Christmas!\n' "$(( 25 - 10#$day ))"
|
||||
fi
|
||||
|
||||
PS1_prompt_sym=🌲
|
||||
fi
|
||||
PS1_prompt_sym=λ
|
||||
PS1_hostname=${HOSTNAME-"$(hostname)"}
|
||||
PS1_color_fail=$(tput setaf 1)
|
||||
PS1_color_success=$(tput setaf 2)
|
||||
PS1_color_reset=$(tput sgr0)
|
||||
|
|
Loading…
Reference in New Issue