testsAndMisc/linux_configuration/scripts/periodic_background/i3-configuration/i3blocks/disk.sh

15 lines
218 B
Bash
Raw Normal View History

#!/bin/bash
# i3blocks disk usage indicator with a single df helper.
set -euo pipefail
{
read -r _
read -r _ size used _
} < <(df -h / 2> /dev/null) || {
echo " N/A"
exit 0
}
echo "${used}/${size}"