61 lines
1.9 KiB
Bash
Executable File
61 lines
1.9 KiB
Bash
Executable File
# If not running interactively, don't do anything
|
|
[[ $- != *i* ]] && return
|
|
|
|
# Load starship prompt if starship is installed
|
|
if [ -x /usr/bin/starship ]; then
|
|
__main() {
|
|
local major="${BASH_VERSINFO[0]}"
|
|
local minor="${BASH_VERSINFO[1]}"
|
|
|
|
if ((major > 4)) || { ((major == 4)) && ((minor >= 1)); }; then
|
|
source <("/usr/bin/starship" init bash --print-full-init)
|
|
else
|
|
source /dev/stdin <<<"$("/usr/bin/starship" init bash --print-full-init)"
|
|
fi
|
|
}
|
|
__main
|
|
unset -f __main
|
|
fi
|
|
|
|
## Aliases
|
|
# Replace ls with exa
|
|
alias ls='exa -al --color=always --group-directories-first' # preferred listing
|
|
alias la='exa -a --color=always --group-directories-first' # all files and dirs
|
|
alias ll='exa -l --color=always --group-directories-first' # long format
|
|
alias lt='exa -aT --color=always --group-directories-first' # tree listing
|
|
alias l.='exa -ald --color=always --group-directories-first .*' # show only dotfiles
|
|
|
|
# Replace cat with bat
|
|
alias cat='bat --style header --style snip --style changes --style header'
|
|
|
|
# Replace yay with paru
|
|
[ ! -x /usr/bin/yay ] && [ -x /usr/bin/paru ] && alias yay='paru'
|
|
|
|
# Aliases
|
|
alias cls='clear'
|
|
alias dir='dir --color=auto'
|
|
alias egrep='grep -E --color=auto'
|
|
alias fgrep='grep -F --color=auto'
|
|
alias igrep='grep -i --color=auto'
|
|
alias fixpacman="sudo rm /var/lib/pacman/db.lck"
|
|
alias grep='grep --color=auto'
|
|
alias grubup="sudo update-grub"
|
|
alias hw='hwinfo --short'
|
|
alias psmem10='ps auxf | sort -nr -k 4 | head -10'
|
|
alias psmem='ps auxf | sort -nr -k 4'
|
|
alias rmpkg="sudo pacman -Rdd"
|
|
alias tarnow='tar -acf '
|
|
alias untar='tar -zxvf '
|
|
alias upd='/usr/bin/update'
|
|
alias vdir='vdir --color=auto'
|
|
alias wget='wget -c '
|
|
|
|
# Cleanup orphaned packages
|
|
alias cleanup='sudo pacman -Rns `pacman -Qtdq`'
|
|
|
|
# Get the error messages from journalctl
|
|
alias jctl="journalctl -p 3 -xb"
|
|
|
|
# Recent installed packages
|
|
alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl"
|