solorice/config/eww/scripts/mem-ad
Kristofers Solo 5f54bb78ad Update 2025-02-24
Update 2025-02-03

Update 2025-02-04

Update 2025-02-09

Update 2025-02-14

Update 2025-02-15

Update 2025-02-22

Update 2025-02-24
2025-04-16 13:46:48 +03:00

15 lines
289 B
Bash

#!/usr/bin/env bash
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