From 02867aa2460bc9c4ea1c39c01bdb2ae5d6695c07 Mon Sep 17 00:00:00 2001 From: brad Date: Sat, 1 Apr 2023 14:19:02 -0500 Subject: [PATCH] shit's getting crazy --- .bash_aliases | 56 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/.bash_aliases b/.bash_aliases index 95e1efc..eb5e622 100755 --- a/.bash_aliases +++ b/.bash_aliases @@ -1,14 +1,50 @@ +# Detect distribution +if [ -f /etc/os-release ]; then + . /etc/os-release +fi + # Application management -# Install something bypassing the prompts -alias inst='sudo apt-get install -y' -# Do a basic update. Ubuntu only -alias update='sudo apt-get update -y && sudo apt-get upgrade -y' -# Upgrade the fuck out of just fucking everything -alias upgrade_all='sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y && sudo apt-get autoclean -y && sudo apt-get --with-new-pkgs upgrade -y' -# Search packages. Ubuntu Only -alias pacs='apt-cache search' -# Uninstall. Ubuntu only. -alias burn='sudo apt-get autoremove' +case "$ID" in + ubuntu|debian) + # Install something bypassing the prompts + alias inst='sudo apt-get install -y' + # Do a basic update + alias update='sudo apt-get update -y && sudo apt-get upgrade -y' + # Upgrade everything + alias upgrade_all='sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y && sudo apt-get autoclean -y && sudo apt-get --with-new-pkgs upgrade -y' + # Search packages + alias pacs='apt-cache search' + # Uninstall + alias burn='sudo apt-get autoremove' + ;; + arch|archlinux) + # Install something bypassing the prompts + alias inst='sudo pacman -S --noconfirm' + # Do a basic update + alias update='sudo pacman -Syu --noconfirm' + # Upgrade everything + alias upgrade_all='sudo pacman -Syu --noconfirm && sudo pacman -Rns $(pacman -Qdtq) --noconfirm && sudo paccache -r' + # Search packages + alias pacs='pacman -Ss' + # Uninstall + alias burn='sudo pacman -Rns --noconfirm' + ;; + alpine) + # Install something bypassing the prompts + alias inst='sudo apk add' + # Do a basic update + alias update='sudo apk update && sudo apk upgrade' + # Upgrade everything + alias upgrade_all='sudo apk update && sudo apk upgrade && sudo apk cache clean' + # Search packages + alias pacs='apk search' + # Uninstall + alias burn='sudo apk del' + ;; + *) + # Add any other distribution-specific aliases here + ;; +esac # General # Get $HOME quick