From e32a4258a8ddacfd77af12f0c6f37f32b27b528b Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Fri, 15 Sep 2023 21:21:01 +0200 Subject: [PATCH] take mount location and icon as argument --- .local/bin/statusbar/sb-disk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.local/bin/statusbar/sb-disk b/.local/bin/statusbar/sb-disk index 90eaefe27..a5fead003 100755 --- a/.local/bin/statusbar/sb-disk +++ b/.local/bin/statusbar/sb-disk @@ -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"