.shincludes/source/simple-aliases
2024-02-05 14:08:12 +02:00

58 lines
1.4 KiB
Text

[ -z "${ID+x}" ] && source /etc/os-release
# depends: paru
{[ "${ID}" = "arch" ] || [ "${ID_LIKE}" = "arch" ]} && {
alias i='paru -S'
alias up='DFT_COLOR=always paru -Syu'
alias whoowns='paru -Qo'
alias ownswhom='paru -Ql'
alias whatprovides='paru -F'
# type pacs 1>/dev/null && alias paru='pacs'
}
# depends: apt-file
{[ "${ID}" = "ubuntu" ] || [ "${ID}" = "debian" ] || [ "${ID_LIKE}" = "debian" ]} && {
alias i='sudo apt install'
alias up='sudo apt update && sudo apt -y full-upgrade'
alias whoowns='dpkg -S'
alias ownswhom='dpkg -L'
function whatprovides {
for file in $@; do
apt-file find -x "/${file}\$"
done
}
}
# depends: dnf
{[ "${ID}" = "rocky" ] || [ "${ID}" = "fedora" ]} && {
alias i='sudo dnf install'
alias up='sudo dnf update'
alias whoowns='rpm -qf'
alias ownswhom='dnf repoquery -l'
alias whatprovides='dnf provides'
}
alias bthp='bluetoothctl power on; bluetoothctl connect 94:DB:56:6B:E3:8A'
alias bgr='systemd-run --user -d --'
alias ip='ip -h -c' # adds some colour
alias ipa='ip -br a' # brief IP listing
# depends: nvim
alias svim='sudo -E nvim'
# depends: eza
alias ls='eza -lh --icons'
alias lst='ls --tree'
alias clear-logs='sudo /bin/sh -c "journalctl --rotate && journalctl --vacuum-time=1s"'
# depends: bat
alias bat='bat -pp'
# depends: lazygit
alias lg='lazygit'
# depends: rsync
alias rcp='rsync -chavzP --stats'