nixos/home/hyprland/ironbar/reference/scripts/mem-ad
Evie Litherland-Smith be1d5fa798 Switch to minimal ironbar implementation
Save reference for later
Enable upower daemon and add simple bar with the essentials for now,
TODO more later
2023-10-11 08:28:27 +01:00

15 lines
324 B
Bash
Executable file

#!/bin/sh
total="$(free -m | grep Mem: | awk '{ print $2 }')"
used="$(free -m | grep Mem: | awk '{ print $3 }')"
shared="$(free -m | grep Mem: | awk '{ print $5 }')"
free=$(expr $total - $used - $shared)
true_used=$(expr $shared + $used)
case $1 in
total) echo $total;;
used) echo $true_used;;
free) echo $free;;
esac