keep parttision number

This commit is contained in:
committer@tuxwarrior
2026-03-17 06:40:14 -05:00
parent 325c44e3f3
commit c2aa87085e

View File

@@ -29,7 +29,7 @@ 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
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).
main_drive=$(df / | awk 'NR==2 {print $1}') # gets the device mounted at /
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}'