+ get main drive
This commit is contained in:
@@ -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}'
|
ps -eo pid,comm,%cpu --sort=-%cpu | head -n 2 | awk 'NR==2 {printf "%s: %s (%s%)", $1, $2, $3}'
|
||||||
elif [[ "${operation}" == "drive" ]]; then
|
elif [[ "${operation}" == "drive" ]]; then
|
||||||
# display used drive space
|
# 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
|
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}'
|
df -h ${extra_arg} | awk 'NR==2 {printf "%s/%s (%s)\n", $3, $2, $5}'
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user