diff options
| author | 0scar <qgt268@alumni.ku.dk> | 2020-12-29 10:28:00 +0000 |
|---|---|---|
| committer | 0scar <qgt268@alumni.ku.dk> | 2020-12-29 10:28:00 +0000 |
| commit | bcea7bd164355687638cca6f30b19cd318d08762 (patch) | |
| tree | 22b8c06827ee43b2b88c55e7464a9a4a448f4023 /.scripts/cpuinfo | |
| parent | afa225e8322c2a53ef755d2f2d02241c36d5111f (diff) | |
Update info urgency + memory notification
Diffstat (limited to '.scripts/cpuinfo')
| -rwxr-xr-x | .scripts/cpuinfo | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/.scripts/cpuinfo b/.scripts/cpuinfo index 8db8456..f46121b 100755 --- a/.scripts/cpuinfo +++ b/.scripts/cpuinfo @@ -1,6 +1,28 @@ #!/usr/bin/env sh set -e +case $BLOCK_BUTTON in + 1) notify-send --urgency=low \ + "Process status" \ + "$(ps -eo pid,pcpu,size,comm \ + | sort -rnk 3 \ + | awk '{printf "% 8s% 8s% 8s ", $1, $2, $3; + $1="";$2="";$3=""; + print $0; c++} + c>10 {exit}')" + ;; + 3) notify-send --urgency=low \ + "Process status" \ + "$(ps -eo pid,pcpu,size,cmd \ + | sort -rnk 3 \ + | cut -b -45 \ + | awk '{printf "% 8s% 8s% 8s ", $1, $2, $3; + $1="";$2="";$3=""; + print $0; c++} + c>10 {exit}')" + ;; +esac + # Load sed -Ee 's/^([0-9]+\.[0-9]+) .*/[\1 /g' /proc/loadavg | tr -d '\n' |
