mirror of https://github.com/tiyn/dotfiles
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
457 B
25 lines
457 B
#!/bin/sh
|
|
|
|
# Status bar module for disk space
|
|
# $1 should be drive mountpoint
|
|
|
|
[ -z "$STATUSBAR_DISK" ] && disk="/home" || disk="$STATUSBAR_DISK"
|
|
|
|
[ ! -z "$1" ] && disk="$1"
|
|
|
|
icon="$disk"
|
|
|
|
free=$(df "$disk" | awk ' /[0-9][0-9]/ {print $4}')
|
|
|
|
if [ $free -gt 104857600 ]
|
|
then
|
|
icon="^b#282828^^c#dfdfdf^ ^d^"
|
|
elif [ $free -gt 52428800 ]
|
|
then
|
|
icon="^b#282828^^c#ffff00^ ^d^"
|
|
else
|
|
icon="^b#282828^^c#ff0000^ ^d^"
|
|
fi
|
|
|
|
printf "$icon %s"
|