From 159b684f949e1768b36b26720d47ab19382f5144 Mon Sep 17 00:00:00 2001 From: dx Date: Thu, 9 Jul 2020 22:08:01 +0100 Subject: +memory script for dwmbar --- Scripts/.local/scripts/status/memory | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 Scripts/.local/scripts/status/memory (limited to 'Scripts/.local/scripts/status/memory') diff --git a/Scripts/.local/scripts/status/memory b/Scripts/.local/scripts/status/memory new file mode 100755 index 0000000..eeaf7af --- /dev/null +++ b/Scripts/.local/scripts/status/memory @@ -0,0 +1,7 @@ +#!/bin/bash + +line=$(free -m | sed -n 2p); +used=$(echo $line | awk '{print $3}'); +available=$(echo $line | awk '{print $2}'); +echo "100 * $used / $available" | bc -l | xargs printf " Mem: %.2f" $1 +echo "%" -- cgit v1.2.3-13-gbd6f