disk (543B)
1 #!/usr/bin/env sh 2 3 # Status bar module for disk space 4 # $1 should be drive mountpoint 5 # $2 is optional icon, otherwise mountpoint will displayed 6 7 [ -z "$1" ] && exit 8 9 icon="$2" 10 [ -z "$2" ] && icon="$1" 11 12 case $BLOCK_BUTTON in 13 1) pgrep -x dunst >/dev/null && notify-send "💽 Disk space" "$(df -h --output=target,used,size)" ;; 14 3) pgrep -x dunst >/dev/null && notify-send "💽 Disk module" "\- Shows used hard drive space. 15 - Click to show all disk info." ;; 16 esac 17 18 printf "%s: %s\n" "$icon" "$(df -h "$1" | awk ' /[0-9]/ {print $3 "/" $2}')"