+ storage

This commit is contained in:
committer@tuxwarrior
2026-03-09 08:41:15 -05:00
parent 8a0cd5c3a7
commit e84ea3d55a
2 changed files with 8 additions and 1 deletions

View File

@@ -5,6 +5,7 @@
displayResources() {
operation=$1
extra_arg=$2
if [[ "${operation}" == "memory" ]]; then
echo /home/poq/.config/nwg-panel/icons/memory-solid-full.svg
@@ -20,9 +21,14 @@ displayResources() {
# the process that consumes the most cpu
echo /home/poq/.config/nwg-panel/icons/noun-cpu-8293079.svg
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}
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
echo ""
fi
}
displayResources $1
displayResources $1 $2