Files
gists/config/shell/bash_aliases
T
tobias f540e08437 fix(shell): repair broken aliases, modernize, make bash/zsh + linux/mac portable
- drop hardcoded /home/tke/.http_proxy sourcing; both proxy installers
  (update_bashrc_proxy.sh #PROXY_A93JK2, install_proxy.sh
  #PROXY_BRIDGE_CONFIG) inject their own bashrc lines
- fix 'set $_Z_OWNER=' (set positional params instead of the variable)
- prefer zoxide over z.sh, load only one jumper instead of both
- dockertags: dead Docker Hub v1 API -> v2, handle library/ prefix
- rot13: handle uppercase
- ppxml: drop dead duplicate with typo'd xmllin command
- exa (unmaintained) -> eza, fallback lsd -> ls; single ll definition
- guard linux-only bits (locate -A, ntfsmount, usbguard, apt+fzf, mc)
  and optional tools with command -v; batcat support for ubuntu
- unsetproxy: grep -P is GNU-only, unset vars explicitly instead
- quote ${workdir:-$(pwd)} mounts; dedupe mv/cp/pip/python
- guard shopt autocd (macOS bash 3.2)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 16:56:39 +02:00

26 lines
1.4 KiB
Bash

# bash-specific setup; portable aliases live in ~/.shell_aliases
PS1='\[\033]0;\u - \w\007\]\[\033[44;37m\]'$(printf '_%.0s' $(seq 1 $(tput cols)))'\[\033[1;0m\]\r\n\t \w :\n\$ '
[[ -f ~/.bash_prompt ]] && . ~/.bash_prompt
alias '+'='pushd .'
alias -- '-'='popd'
command -v notify-send >/dev/null 2>&1 && alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
command -v pushover >/dev/null 2>&1 && alias pushalert='pushover --title "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
[[ -f ~/.shell_aliases ]] && . ~/.shell_aliases
# directory jumper: zoxide where installed, z.sh as fallback (proxy env is installer-managed, see scripts/proxy/)
if command -v zoxide >/dev/null 2>&1; then
eval "$(zoxide init bash)"
elif [[ -x ~/.cargo/bin/zoxide ]]; then
eval "$(~/.cargo/bin/zoxide init bash)"
elif [[ -f ~/.config/z.sh ]]; then
. ~/.config/z.sh
elif [[ -f ~/.oh-my-zsh/plugins/z/z.sh ]]; then
export _Z_OWNER=$(whoami)
. ~/.oh-my-zsh/plugins/z/z.sh
fi
[[ -f /usr/share/doc/fzf/examples/key-bindings.bash ]] && source /usr/share/doc/fzf/examples/key-bindings.bash
[[ -f /usr/share/doc/fzf/examples/completion.bash ]] && source /usr/share/doc/fzf/examples/completion.bash
HISTTIMEFORMAT="%F %T "
shopt -s autocd 2>/dev/null || true # bash >= 4 only; macOS ships 3.2