dwmbar/modules/disksize

17 lines
356 B
Text
Raw Permalink Normal View History

2019-10-22 14:31:25 +00:00
#!/bin/bash
# Prints out the total disk memory and the available memory
2019-10-22 14:31:25 +00:00
PREFIX=' '
get_disk()
{
2019-10-22 18:19:33 +00:00
TOTAL_SIZE=$( df -h --total | tail -1 | awk {'printf $2'})
USED_SIZE=$(df -h --total | tail -1 | awk {'printf $3'})
PERCENTAGE=$(df -h --total | tail -1 | awk {'printf $5'})
2019-10-22 14:31:25 +00:00
echo "$PREFIX$USED_SIZE/$TOTAL_SIZE ($PERCENTAGE)"
}
get_disk