2024-10-31 22:09:39 +01:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
# Easier navigation: .., ..., ...., ....., ~ and -
|
|
|
|
|
alias ..="cd .."
|
|
|
|
|
alias ...="cd ../.."
|
|
|
|
|
alias ....="cd ../../.."
|
|
|
|
|
alias .....="cd ../../../.."
|
|
|
|
|
alias -- -="cd -"
|
|
|
|
|
|
|
|
|
|
# Shortcuts
|
|
|
|
|
alias dl="cd ~/Downloads"
|
|
|
|
|
alias g="git"
|
|
|
|
|
alias h="history"
|
|
|
|
|
|
|
|
|
|
## Editor
|
|
|
|
|
alias e='$EDITOR '
|
|
|
|
|
alias E='sudo $EDITOR '
|
|
|
|
|
|
|
|
|
|
# Always use color output for `ls`
|
|
|
|
|
# And sort directories before files
|
|
|
|
|
alias ls="ls --color --group-directories-first"
|
|
|
|
|
|
|
|
|
|
# ls abbreviation
|
|
|
|
|
alias l="ls -l"
|
|
|
|
|
alias ll="ls -l"
|
|
|
|
|
alias la="ls -la"
|
|
|
|
|
alias ltr="ls -ltr"
|
|
|
|
|
|
|
|
|
|
# Always enable colored `grep` output
|
|
|
|
|
alias grep='grep --color=auto '
|
|
|
|
|
|
|
|
|
|
# Enable colors for less
|
|
|
|
|
alias less="less -R"
|
|
|
|
|
|
|
|
|
|
# Enable aliases to be sudo’ed
|
|
|
|
|
alias sudo='sudo '
|
|
|
|
|
|
|
|
|
|
# Canonical hex dump some systems have this symlinked
|
|
|
|
|
command -v hd > /dev/null || alias hd="hexdump -C"
|
|
|
|
|
|
|
|
|
|
# vi == vim
|
|
|
|
|
alias vi='vim'
|
|
|
|
|
|
|
|
|
|
# Temperatursensoren mit Pfad
|
|
|
|
|
alias get_systemp="paste <(cat /sys/class/thermal/thermal_zone*/type) <(cat /sys/class/thermal/thermal_zone*/temp) <(ls -1 /sys/class/thermal/thermal_zone*/temp) | column -s $'\t' -t"
|
|
|
|
|
|
|
|
|
|
# Spezialitäten für Arch Linux
|
|
|
|
|
alias y_clean='pikaur -Rs $(pikaur -Qtdq)'
|
|
|
|
|
alias y_update='pikaur -Syu'
|
|
|
|
|
alias y_inst='pikaur -Sy'
|
|
|
|
|
alias y_rem='pikaur -Rsn'
|
|
|
|
|
|
|
|
|
|
# Passwort erstellen
|
|
|
|
|
alias mkpasswd='openssl rand -base64 40 | cut -c1-40'
|
|
|
|
|
|
2024-11-02 13:54:41 +01:00
|
|
|
|
# Add an "alert" alias for long running commands. Use like so:
|
|
|
|
|
# sleep 10; alert
|
|
|
|
|
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$//'\'')"'
|
|
|
|
|
|