From 129126ba11abb950c7967105ad7e8f9bd74feef2 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 19 Oct 2020 23:58:38 +0100 Subject: [PATCH 1/2] Added ram percentage module --- modules/ram_perc | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 modules/ram_perc 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 From 10453b8910890d90055ecf03567f950232710684 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 20 Oct 2020 00:36:54 +0100 Subject: [PATCH 2/2] Added uptime module --- modules/uptime | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 modules/uptime diff --git a/modules/uptime b/modules/uptime new file mode 100755 index 0000000..2c771d4 --- /dev/null +++ b/modules/uptime @@ -0,0 +1,13 @@ +#!/bin/bash + +# Prints the total ram and used ram in Mb + +PREFIX='' + +get_uptime() +{ + UPTIME=$(uptime | sed 's/.*up \([^,]*\), .*/\1/') + echo "$PREFIX$UPTIME" +} + +get_uptime