+ storage
This commit is contained in:
@@ -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
|
||||
|
||||
1
dots/nwg-panel/icons/noun-storage-5078021.svg
Normal file
1
dots/nwg-panel/icons/noun-storage-5078021.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="-4.9 -9.8 107.8 132.29999999999998" style="enable-background:new 0 0 98 98;" xml:space="preserve"><path fill="white" d="M49,86.519c-16.321,0-32.844-4.424-32.844-12.88V24.361c0-8.456,16.523-12.88,32.844-12.88s32.844,4.424,32.844,12.88 v49.278C81.844,82.095,65.321,86.519,49,86.519z M20.845,64.184v9.454c0,3.34,10.968,8.19,28.155,8.19s28.155-4.851,28.155-8.19 v-9.454C71.092,68.083,60,70.093,49,70.093S26.908,68.083,20.845,64.184z M20.845,57.213c0,3.34,10.968,8.19,28.155,8.19 s28.155-4.851,28.155-8.19v-9.454C71.092,51.658,60,53.667,49,53.667s-22.092-2.009-28.155-5.908V57.213z M20.845,40.787 c0,3.34,10.968,8.191,28.155,8.191s28.155-4.851,28.155-8.191v-9.454C71.092,35.232,60,37.241,49,37.241s-22.092-2.009-28.155-5.908 V40.787z M49,16.171c-17.187,0-28.155,4.851-28.155,8.19s10.968,8.19,28.155,8.19s28.155-4.851,28.155-8.19S66.187,16.171,49,16.171 z"/></svg>
|
||||
|
After Width: | Height: | Size: 986 B |
Reference in New Issue
Block a user