aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-10-22 15:18:44 +0100
committerManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-10-22 15:18:44 +0100
commitd66f63d8fa6e1ac9d89ac19d44464d7ac8ccbd31 (patch)
tree9695d3593a8b5287558a98c827bbd20cd938c262 /modules
parent1fb47edc46197a8480d525351d47ff15c6e5a2a4 (diff)
Added ram module
Diffstat (limited to 'modules')
-rw-r--r--modules/ram16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/ram b/modules/ram
new file mode 100644
index 0000000..a2e359b
--- /dev/null
+++ b/modules/ram
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# Prints the total ram and used ram in Mb
+
+PREFIX='﬙ '
+
+get_ram()
+{
+ TOTAL_RAM=$(free -m | awk {'print $2'} | head -n 2 | tail -1)
+ FREE_RAM=$(free -m | awk {'print $3'} | head -n 2 | tail -1)
+ MB="MB"
+
+ echo "$PREFIX$FREE_RAM/$TOTAL_RAM$MB"
+}
+
+get_ram