dwmbar/modules/disksize
2023-01-02 13:59:13 -05:00

16 lines
356 B
Bash
Executable file

#!/bin/bash
# Prints out the total disk memory and the available memory
PREFIX=' '
get_disk()
{
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'})
echo "$PREFIX$USED_SIZE/$TOTAL_SIZE ($PERCENTAGE)"
}
get_disk