diff options
Diffstat (limited to 'modules/ram_perc')
-rwxr-xr-x | modules/ram_perc | 13 |
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 |