diff options
Diffstat (limited to 'dot_config/waybar/executable_memory-status.sh')
| -rwxr-xr-x | dot_config/waybar/executable_memory-status.sh | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/dot_config/waybar/executable_memory-status.sh b/dot_config/waybar/executable_memory-status.sh index c68f5a4..33ccc04 100755 --- a/dot_config/waybar/executable_memory-status.sh +++ b/dot_config/waybar/executable_memory-status.sh @@ -10,20 +10,12 @@ function heat(p) { if (p < 80) return "#fe8019" return "#fb4934" } -function cool(p) { - if (p < 20) return "#fb4934" - if (p < 40) return "#fe8019" - if (p < 70) return "#fabd2f" - return "#b8bb26" -} /^MemTotal:/ { t = $2 } /^MemAvailable:/ { a = $2 } END { u = t - a up = u * 100 / t - ap = a * 100 / t - printf "{\"text\":\"MEM %.1fG (<span color=\x27%s\x27>%d%%</span>) / %.1fG (<span color=\x27%s\x27>%d%%</span>)\"}\n", \ - u / 1048576, heat(up), up, \ - a / 1048576, cool(ap), ap + printf "{\"text\":\"MEM %.1fG <span color=\x27%s\x27>%d%%</span>\"}\n", \ + u / 1048576, heat(up), up } ' /proc/meminfo |
