Dotfiles-dwm/dwmbar/modules/disksize

17 lines
349 B
Plaintext
Raw Normal View History

2024-06-02 11:02:06 +00:00
#!/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 "$USED_SIZE/$TOTAL_SIZE ($PERCENTAGE)"
}
get_disk