Files
dotfiles/dwm/dwmbar/modules/disksize
T
2024-07-02 12:31:42 +07:00

17 lines
354 B
Bash
Executable File

#!/bin/bash
# Prints out the total disk memory and the available memory
PREFIX=' '
get_disk()
{
TOTAL_SIZE=$( df -h --total | rg 230 | awk {'printf $2'})
USED_SIZE=$(df -h --total | rg 230 | awk {'printf $3'})
PERCENTAGE=$(df -h --total | rg 230 | awk {'printf $5'})
echo "$PREFIX$USED_SIZE/$TOTAL_SIZE ($PERCENTAGE)"
}
get_disk