From 11f862a549c44e0d5e959ce7817a899a3a4940d6 Mon Sep 17 00:00:00 2001 From: fennek182 Date: Sun, 14 Jun 2026 18:20:08 +0200 Subject: [PATCH] updated stats bash script ( --- .local/bin/stats | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.local/bin/stats b/.local/bin/stats index ec82bb7..89c9454 100755 --- a/.local/bin/stats +++ b/.local/bin/stats @@ -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. +# Written by: fennek182 +# 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)"