1
0
Fork 0

take mount location and icon as argument

This commit is contained in:
Luca Bilke 2023-09-15 21:21:01 +02:00
parent 4ffa3fecad
commit e32a4258a8
1 changed files with 5 additions and 2 deletions

View File

@ -1,9 +1,12 @@
#!/bin/sh
# $1 should be drive mountpoint, otherwise assumed /.
# $2 should be an icon, otherwise  is used.
reset="\033[0m"
big="\033[11m"
big="\033[12m"
defaulticon=""
location=${1:-/}
[ -d "$location" ] || exit
printf "%b" "$big$reset $(df -H "$location" | awk ' /[0-9]/ {print $3 "/" $2}')\n"
[ -z "$2" ] && icon="$defaulticon" || icon="$2"
printf "%b" "$big$icon$reset $(df -H "$location" | awk ' /[0-9]/ {print $3 "/" $2}')\n"