2022-07-04 21:36:33 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# $1 should be drive mountpoint, otherwise assumed /.
|
2023-09-15 21:21:01 +02:00
|
|
|
# $2 should be an icon, otherwise is used.
|
2023-05-24 18:33:43 +02:00
|
|
|
|
|
|
|
reset="\033[0m"
|
2023-09-15 21:21:01 +02:00
|
|
|
big="\033[12m"
|
|
|
|
defaulticon=""
|
2023-05-24 18:33:43 +02:00
|
|
|
|
2022-07-04 21:36:33 +02:00
|
|
|
location=${1:-/}
|
|
|
|
[ -d "$location" ] || exit
|
2023-09-15 21:21:01 +02:00
|
|
|
[ -z "$2" ] && icon="$defaulticon" || icon="$2"
|
|
|
|
printf "%b" "$big$icon$reset $(df -H "$location" | awk ' /[0-9]/ {print $3 "/" $2}')\n"
|