From 48ad841f56bb73da2734f571507ece7848615e61 Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Wed, 3 Mar 2021 22:47:20 -0700 Subject: DELETE i3GAPS BLOCKS that I forgot, slightly changes to blog management tools --- .local/bin/blocks/memory | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100755 .local/bin/blocks/memory (limited to '.local/bin/blocks/memory') diff --git a/.local/bin/blocks/memory b/.local/bin/blocks/memory deleted file mode 100755 index c581a53..0000000 --- a/.local/bin/blocks/memory +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -LABEL=${LABEL:"+"} -TYPE="${TYPE:-mem}" - -awk -v type=$TYPE ' -/^MemTotal:/ { - mem_total=$2 -} -/^MemFree:/ { - mem_free=$2 -} -/^Buffers:/ { - mem_free+=$2 -} -/^Cached:/ { - mem_free+=$2 -} -END { - free=mem_free/1024/1024 - used=(mem_total-mem_free)/1024/1024 - total=mem_total/1024/1024 - - pct=0 - if (total > 0) { - pct=used/total*100 - } - - # Full text. - # printf("%s %.1fG/%.1fG (%.f%%)\n", LABEL, used, total, pct) - printf("%s %.1fG\n", LABEL, used) - # Short text. - printf("%s %.f%%\n", LABEL, pct) - - # Color. - if (pct > 90) { - print("#FF0000") - } else if (pct > 80) { - print("#FFAE00") - } else if (pct > 70) { - print("#FFF600") - } -} -' /proc/meminfo -- cgit v1.2.3-54-g00ecf