Beginning of macOS and Linux dotfiles separation and quality improvements

This commit is contained in:
2024-01-30 17:04:26 +00:00
parent a4b1677cb2
commit 6f8394aabe
20 changed files with 107 additions and 49 deletions

View File

@@ -0,0 +1,34 @@
#! /bin/bash
source ~/dotfiles/scripts/p.sh
source ~/dotfiles/scripts/color.sh
echo -e "${GREEN}[+] Upgrading...${ENDCOLOR}"
p
echo -e "${GREEN}[+] Cleaning orphaned (unneeded) packages...${ENDCOLOR}"
sudo paru -Rsn $(paru -Qdtq)
echo -e "${GREEN}[+] Cleaning old pacman cache...${ENDCOLOR}"
if p c pacman-contrib &>/dev/null; then
paccache -rk1
else
p i pacman-contrib
paccache -rk1
fi
echo -e "${GREEN}[+] Removing logs older than 7d...${ENDCOLOR}"
sudo journalctl --vacuum-time=7d
if p c flatpak &>/dev/null; then
echo -e "${GREEN}[+] Cleaning flatpak...:${ENDCOLOR}"
flatpak remove --unused
fi
echo -e "${GREEN}[i] AUR Packages installed:${ENDCOLOR}"
pacman -Qim | awk '/^Name/{name=$3} /^Installed Size/{print $4$5, name}' | sort -h
# Installed packages: pacman -Qen
echo
read -p "Press enter to exit."