Compare commits
No commits in common. "d4d5e4e9b36fae247b9102c04c8c84eac82e1969" and "3664bb3f711796f566d772de7a17a696cdfe430b" have entirely different histories.
d4d5e4e9b3
...
3664bb3f71
5 changed files with 13 additions and 45 deletions
2
.bashrc
2
.bashrc
|
@ -67,7 +67,7 @@ add_path() {
|
||||||
###
|
###
|
||||||
|
|
||||||
__dotlib_load_libraries() {
|
__dotlib_load_libraries() {
|
||||||
local os dot{,s}
|
local os dot dots
|
||||||
|
|
||||||
case $OSTYPE in
|
case $OSTYPE in
|
||||||
darwin*)
|
darwin*)
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
calendar-determine-holiday() {
|
|
||||||
local month day
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
calendar-determine-holiday
|
|
|
@ -1,12 +1,12 @@
|
||||||
cattle-reset-elapsed() {
|
reset-elapsed() {
|
||||||
(( last_cmd_at = SECONDS ))
|
(( last_cmd_at = SECONDS ))
|
||||||
}
|
}
|
||||||
|
|
||||||
cattle-ping-timer() {
|
ping-timer() {
|
||||||
kill -USR1 "$reaper_pid"
|
kill -USR1 "$reaper_pid"
|
||||||
}
|
}
|
||||||
|
|
||||||
cattle-slay-reaper() {
|
slay-reaper() {
|
||||||
kill -KILL "$reaper_pid"
|
kill -KILL "$reaper_pid"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ cd() {
|
||||||
|
|
||||||
{
|
{
|
||||||
trap "" INT
|
trap "" INT
|
||||||
trap cattle-reset-elapsed USR1
|
trap reset-elapsed USR1
|
||||||
last_cmd_at=0
|
last_cmd_at=0
|
||||||
|
|
||||||
while sleep 1; do
|
while sleep 1; do
|
||||||
|
@ -30,8 +30,8 @@ cd() {
|
||||||
done
|
done
|
||||||
} &
|
} &
|
||||||
|
|
||||||
reaper_pid=$! PROMPT_COMMAND+=(cattle-ping-timer)
|
reaper_pid=$! PROMPT_COMMAND+=(ping-timer)
|
||||||
trap cattle-slay-reaper EXIT
|
trap slay-reaper EXIT
|
||||||
|
|
||||||
if [[ -f /tmp/iterm2-prev-dir.txt ]]; then
|
if [[ -f /tmp/iterm2-prev-dir.txt ]]; then
|
||||||
cur_time=$(date +%s)
|
cur_time=$(date +%s)
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
tab-ssh-hosts() {
|
_ssh_hosts() {
|
||||||
mapfile -t hosts < <(awk 'tolower($1) == "host" { print $2 }' ~/.ssh/config)
|
mapfile -t hosts < <(awk 'tolower($1) == "host" { print $2 }' ~/.ssh/config)
|
||||||
mapfile -t COMPREPLY < <(compgen -W "${hosts[*]}" -- "${COMP_WORDS[COMP_CWORD]}")
|
mapfile -t COMPREPLY < <(compgen -W "${hosts[*]}" -- "${COMP_WORDS[COMP_CWORD]}")
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
complete -o default -F tah-ssh-hosts ssh scp ssh-copy-id sftp
|
complete -o default -F _ssh_hosts ssh scp ssh-copy-id sftp
|
||||||
|
|
||||||
tab-make-targets() {
|
_make_targets() {
|
||||||
local arg prev file targets
|
local arg prev file targets
|
||||||
|
|
||||||
if [[ -f makefile ]]; then
|
if [[ -f makefile ]]; then
|
||||||
|
@ -34,4 +34,4 @@ tab-make-targets() {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
complete -o default -F tab-make-targets make gmake
|
complete -o default -F _make_targets make gmake
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
prompt-init() {
|
setup-prompt() {
|
||||||
local last_res=$? color=$PS1_color_success
|
local last_res=$? color=$PS1_color_success
|
||||||
PS1="\w "
|
PS1="\w "
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ prompt-init() {
|
||||||
PS1+="\[$color\][$last_res]\[$PS1_color_reset\] $PS1_prompt_sym "
|
PS1+="\[$color\][$last_res]\[$PS1_color_reset\] $PS1_prompt_sym "
|
||||||
}
|
}
|
||||||
|
|
||||||
PROMPT_COMMAND+=(prompt-init)
|
PROMPT_COMMAND+=(setup-prompt)
|
||||||
|
|
||||||
PS1_prompt_sym=λ
|
PS1_prompt_sym=λ
|
||||||
PS1_hostname=${HOSTNAME-"$(hostname)"}
|
PS1_hostname=${HOSTNAME-"$(hostname)"}
|
||||||
|
|
Loading…
Reference in a new issue