+ get main drive

This commit is contained in:
committer@tuxwarrior
2026-03-17 06:35:35 -05:00
parent 2cc037e672
commit 325c44e3f3

View File

@@ -29,7 +29,8 @@ displayResources() {
ps -eo pid,comm,%cpu --sort=-%cpu | head -n 2 | awk 'NR==2 {printf "%s: %s (%s%)", $1, $2, $3}'
elif [[ "${operation}" == "drive" ]]; then
# display used drive space
extra_arg=${extra_arg:=/dev/nvme0n1p2}
main_drive=$(df / | awk 'NR==2 {print $1}' | sed 's/[0-9]*$//') # This gets the device mounted at /, removes partition numbers, and returns the disk (e.g., /dev/sda).
extra_arg=${extra_arg:=${main_drive}}
echo /home/poq/.config/nwg-panel/icons/noun-storage-5078021.svg
df -h ${extra_arg} | awk 'NR==2 {printf "%s/%s (%s)\n", $3, $2, $5}'
else