From 85ae438fbc238fe56bcb1c10a12ec52365053cb6 Mon Sep 17 00:00:00 2001 From: Biswakalyan Bhuyan Date: Sat, 26 Feb 2022 20:31:12 +0530 Subject: dwmbar dotfiles --- modules/ram_perc | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 modules/ram_perc (limited to '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 -- cgit v1.2.3-59-g8ed1b