updated stats bash script (

This commit is contained in:
2026-06-14 18:20:08 +02:00
parent 9a0b52eb8c
commit 11f862a549
+8 -10
View File
@@ -1,21 +1,19 @@
#!/bin/bash
# Written by: fennek182
# Version: 1
# Last change: Sun 2026-06-14
# Git repo: https://git.fennek.xyz/fennek182/dotfiles
# Description: For my personal use currently. Outputs useful disk usage and package stats.
# Version: 2
# Last change: Sun 2026-06-14
# Git repo: https://git.fennek.xyz/fennek182/dotfiles
# Latest version: https://git.fennek.xyz/fennek182/dotfiles/src/branch/main/.local/bin/stats
# Description: For my personal use currently. Outputs useful disk usage and package stats.
# TODO: move repeating string manipluations to functions
# TODO: clean up formatting, use colors (and maybe glow)
# total size of installed pacman packages
# expac %m | awk '{sum+=$1} END {printf "%.2fGiB\n", sum/2^30}' | grep -oe '[0-9]*\.*' | tr '\n' '\0' | cut -c1-
sum=$(expac %m | awk '{sum+=$1} END {printf "%.2fGiB\n", sum/2^30}' | cut -c 1-4)
sum=$(awk "BEGIN{print $sum*1073741824/1000/1000/1000}" | cut -c-3 | tr . ,) #limit to 2 decimals, replace "." with ","
# TODO: better stats:#
# sudo /bin/du -xcsh /etc /opt /root /run /usr /var && echo " " && sudo /bin/du -sh /home
# --- todo --- : move repeating string manipluations to functions
df -h -H -x tmpfs -x efivarfs -x devtmpfs -T -x vfat | head -n3
echo "----------"
echo "Pacman packages installed: $(pacman -Qq | wc -l)"