dwmbar/modules/ram

17 lines
291 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()
{
2019-10-22 18:14:56 +00:00
TOTAL_RAM=$(free -mh --si | awk {'print $2'} | head -n 2 | tail -1)
USED_RAM=$(free -mh --si | awk {'print $3'} | head -n 2 | tail -1)
2019-10-22 14:18:44 +00:00
MB="MB"
2019-10-22 18:02:08 +00:00
echo "$PREFIX$USED_RAM/$TOTAL_RAM"
2019-10-22 14:18:44 +00:00
}
get_ram