dwmbar/modules/ram

17 lines
282 B
Text
Raw Normal View History

2019-10-22 14:18:44 +00:00
#!/bin/bash
# Prints the total ram and used ram in Mb
2019-10-22 17:58:08 +00:00
PREFIX=' '
2019-10-22 14:18:44 +00:00
get_ram()
{
TOTAL_RAM=$(free -m | awk {'print $2'} | head -n 2 | tail -1)
FREE_RAM=$(free -m | awk {'print $3'} | head -n 2 | tail -1)
MB="MB"
echo "$PREFIX$FREE_RAM/$TOTAL_RAM$MB"
}
get_ram