From cc6d6fcfc6e8403e87dae9f092e61f0edf8e3cc6 Mon Sep 17 00:00:00 2001 From: ryo Date: Wed, 30 Oct 2024 20:10:03 +0000 Subject: Initial commit --- config/i3blocks/scripts/ram | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 config/i3blocks/scripts/ram (limited to 'config/i3blocks/scripts/ram') diff --git a/config/i3blocks/scripts/ram b/config/i3blocks/scripts/ram new file mode 100755 index 0000000..ebf8309 --- /dev/null +++ b/config/i3blocks/scripts/ram @@ -0,0 +1,14 @@ +#!/usr/bin/env dash + +ram=$(awk ' +/MemTotal/ { total = $2 } +/Active:/ { active = $2 } +END {print int((active/total)*100)} +' /proc/meminfo) + +echo ": $ram%" +echo "R: $ram" + +if [ "$ram" -gt 80 ]; then + echo "#FF0000" +fi -- cgit v1.2.3