diff options
author | David Phillips <david@yeah.nah.nz> | 2022-02-02 10:39:51 +1300 |
---|---|---|
committer | David Phillips <david@yeah.nah.nz> | 2022-02-02 10:40:16 +1300 |
commit | 28b82022eb0a2ee4121d517700906984f8eb0734 (patch) | |
tree | f1c656810cd706ae3e5338b7adb8a93764bb657e /bashrc | |
parent | 8d5e29dbcff5399307f30bb0c48f7e2fbb09f364 (diff) | |
download | dotfiles-master.tar.xz |
This fixes broken scp.
Diffstat (limited to 'bashrc')
-rw-r--r-- | bashrc | 55 |
1 files changed, 12 insertions, 43 deletions
@@ -1,50 +1,19 @@ #!/usr/bin/bash -c_off='\e[0m' -c_bold='\e[1m' -c_black='\e[30m' -c_red='\e[31m' -c_green='\e[32m' -c_yellow='\e[33m' -c_blue='\e[34m' -c_purple='\e[35m' -c_cyan='\e[36m' -c_white='\e[37m' - export HISTSIZE=10000 export HISTTIMEFORMAT="%y-%m-%d %T " -source /usr/share/git/completion/git-prompt.sh - -if [ "$TERM" == "st-256color" ]; then - # Quick fix for ctrl+arrow key in st - echo $(tput smkx) > /dev/tty -fi - -############### -PS1="${c_bold}${c_yellow}\ -┌[${c_green}\u${c_yellow}@${c_blue}\h${c_yellow}][${c_purple}\W${c_yellow}"'$(__git_ps1 " (%s)")'"] ${c_black}<\d \t>${c_yellow}\n\ -└╼ \[${c_off}\]" -############### - -source ~/.aliases -source ~/.environment - -echo Running $(uname) $(uname -r) on $(uname -n) \($(uname -m)\) - -if [ -f ~/todo ]; then - echo To do: - cat ~/todo -fi - -if [ -f ~/.cache/weather/forecast ]; then - echo "" - echo Weather: - cat ~/.cache/weather/forecast | while read -r l ; do echo " "$l ; done -fi +case $- in + *i*) + # interactive, continue fancy stuff. Printing anything when a + # non-interactive session is active breaks scp and other utils + source ~/.aliases + source ~/.environment -[ -d ~/Maildir/new/ ] && [ "$(ls ~/Maildir/new/)" ] && echo 'New mail' + echo Running $(uname) $(uname -r) on $(uname -n) \($(uname -m)\) + ;; + *) + # non-interactive, don't do anything fancy + ;; +esac -[ -z "$(ls -A ~/.cache/currency 2>/dev/null)" ] || for c in ~/.cache/currency/* ; do - echo "$(cat $c) (at $(date -d $(stat -c %Y $c) +"%a %d %H:%M"))" -done |