aboutsummaryrefslogtreecommitdiff
path: root/modules/ram_perc
diff options
context:
space:
mode:
authorYour Name <you@example.com>2020-10-19 23:58:38 +0100
committerYour Name <you@example.com>2020-10-19 23:58:38 +0100
commit129126ba11abb950c7967105ad7e8f9bd74feef2 (patch)
treef14b08dba98d1ea1283e1eeea0e6002b814a5992 /modules/ram_perc
parent8f1feacf875ba299fa415ab6927320409359b0fd (diff)
Added ram percentage module
Diffstat (limited to 'modules/ram_perc')
-rwxr-xr-xmodules/ram_perc13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/ram_perc b/modules/ram_perc
new file mode 100755
index 0000000..40c2b2f
--- /dev/null
+++ b/modules/ram_perc
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# Prints the total ram and used ram in Mb
+
+PREFIX=' '
+
+get_ram()
+{
+ USED_RAM=$(free | awk '/Mem/{printf("%d"), $3/$2*100}')
+ echo "$PREFIX$USED_RAM%"
+}
+
+get_ram