Compare commits
2 Commits
91b777ebf4
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f93509afda | ||
|
|
16e77aaf92 |
1
README.md
Normal file
1
README.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
CommunityExtensions::STL::Exporter.export("C:/users/rankzy/Documents/export.stl", Sketchup.active_model.active_entities, {'selection_only' => false, 'export_units' => 'Model Units', 'stl_format' => 'ASCII'})
|
||||||
48
clean.sh
48
clean.sh
@@ -2,26 +2,58 @@
|
|||||||
# Arch Linux cleanup + update script
|
# Arch Linux cleanup + update script
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Function to get used space in kilobytes
|
||||||
|
get_used_space() {
|
||||||
|
df / --output=used | tail -1
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "==> Calculating initial disk usage..."
|
||||||
|
PRE_USED=$(get_used_space)
|
||||||
|
|
||||||
|
echo "==> Cleaning leftover downloads..."
|
||||||
|
sudo rm -rf /var/cache/pacman/pkg/*.part
|
||||||
|
sudo rm -rf /var/cache/pacman/pkg/download-*
|
||||||
|
|
||||||
|
echo "==> Cleaning package cache..."
|
||||||
|
yay -Scc --noconfirm
|
||||||
|
|
||||||
|
echo "==> Cleaning user cache..."
|
||||||
|
sudo rm -rf ~/.cache/*
|
||||||
|
|
||||||
echo "==> Updating packages..."
|
echo "==> Updating packages..."
|
||||||
yay -Syu --noconfirm
|
yay -Syu --noconfirm
|
||||||
|
|
||||||
echo "==> Removing orphaned dependencies..."
|
echo "==> Removing orphaned dependencies..."
|
||||||
|
if [[ -n $(pacman -Qdtq) ]]; then
|
||||||
yay -Yc --noconfirm
|
yay -Yc --noconfirm
|
||||||
|
fi
|
||||||
|
|
||||||
echo "==> Checking for broken packages..."
|
echo "==> Checking for broken packages..."
|
||||||
yay -Dk
|
yay -Dk
|
||||||
|
|
||||||
echo "==> Cleaning package cache..."
|
|
||||||
yay -Sc --noconfirm
|
|
||||||
|
|
||||||
echo "==> Cleaning user cache..."
|
|
||||||
rm -rf ~/.cache/*
|
|
||||||
|
|
||||||
echo "==> Emptying trash..."
|
echo "==> Emptying trash..."
|
||||||
rm -rf ~/.local/share/Trash/files/*
|
sudo rm -rf ~/.local/share/Trash/files/*
|
||||||
rm -rf ~/.local/share/Trash/info/*
|
sudo rm -rf ~/.local/share/Trash/info/*
|
||||||
|
|
||||||
echo "==> Cleaning system logs..."
|
echo "==> Cleaning system logs..."
|
||||||
sudo journalctl --vacuum-time=7d
|
sudo journalctl --vacuum-time=7d
|
||||||
|
|
||||||
|
echo "==> Calculating final disk usage..."
|
||||||
|
POST_USED=$(get_used_space)
|
||||||
|
|
||||||
|
# Calculate difference
|
||||||
|
DIFF=$((PRE_USED - POST_USED))
|
||||||
|
|
||||||
echo "==> Done."
|
echo "==> Done."
|
||||||
|
|
||||||
|
if [ "$DIFF" -gt 0 ]; then
|
||||||
|
# Convert KB to human readable format
|
||||||
|
CLEANED=$(numfmt --from-unit=1024 --to=iec-i --suffix=B "$DIFF")
|
||||||
|
echo "Successfully cleared $CLEANED of disk space."
|
||||||
|
elif [ "$DIFF" -lt 0 ]; then
|
||||||
|
# If updates were larger than the cleanup
|
||||||
|
ADDED=$(numfmt --from-unit=1024 --to=iec-i --suffix=B "${DIFF#-}")
|
||||||
|
echo "Cleanup finished, but system size increased by $ADDED due to updates."
|
||||||
|
else
|
||||||
|
echo "Cleanup finished. No change in disk usage."
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user