aboutsummaryrefslogtreecommitdiff
path: root/.config/eww/scripts/mem-ad
diff options
context:
space:
mode:
Diffstat (limited to '.config/eww/scripts/mem-ad')
-rwxr-xr-x.config/eww/scripts/mem-ad15
1 files changed, 15 insertions, 0 deletions
diff --git a/.config/eww/scripts/mem-ad b/.config/eww/scripts/mem-ad
new file mode 100755
index 0000000..1e4cf89
--- /dev/null
+++ b/.config/eww/scripts/mem-ad
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+
+total="$(free -m | grep Mem: | awk '{ print $2 }')"
+used="$(free -m | grep Mem: | awk '{ print $3 }')"
+
+free=$(expr $total - $used)
+
+if [ "$1" = "total" ]; then
+ echo $total
+elif [ "$1" = "used" ]; then
+ echo $used
+elif [ "$1" = "free" ]; then
+ echo $free
+fi