aboutsummaryrefslogtreecommitdiff
path: root/config/i3blocks/scripts/ram
diff options
context:
space:
mode:
Diffstat (limited to 'config/i3blocks/scripts/ram')
-rwxr-xr-xconfig/i3blocks/scripts/ram14
1 files changed, 14 insertions, 0 deletions
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