push changes
This commit is contained in:
@@ -26,17 +26,17 @@ markup_escape() {
|
||||
icon_markup() {
|
||||
local icon="$1"
|
||||
local color="$2"
|
||||
printf '<span font_desc="SauceCodePro Nerd Font 15" foreground="%s">%s</span>' "$color" "$icon"
|
||||
printf '<span font_desc="SauceCodePro Nerd Font 14" foreground="%s">%s</span>' "$color" "$icon"
|
||||
}
|
||||
|
||||
if mountpoint -q "$MOUNT"; then
|
||||
read -r used avail pcent <<< "$(df -h --output=used,avail,pcent "$MOUNT" | tail -1)"
|
||||
text="<span foreground=\"#D8DEE9\">$(markup_escape "$LABEL $used/$avail ($pcent)")</span> $(icon_markup "$ICON_MOUNT" "#A3BE8C")"
|
||||
text="$(icon_markup "$ICON_MOUNT" "#A3BE8C") <span foreground=\"#D8DEE9\">$(markup_escape "$LABEL $used/$avail ($pcent)")</span>"
|
||||
tooltip="$(markup_escape "$MOUNT mounted - used: $used, free: $avail ($pcent)")"
|
||||
printf '{"text":"%s","tooltip":"%s","class":"mounted"}\n' \
|
||||
"$(json_escape "$text")" "$(json_escape "$tooltip")"
|
||||
else
|
||||
text="<span foreground=\"#EBCB8B\">$(markup_escape "$LABEL N/A")</span> $(icon_markup "$ICON_DOWN" "#BF616A")"
|
||||
text="$(icon_markup "$ICON_DOWN" "#BF616A") <span foreground=\"#EBCB8B\">$(markup_escape "$LABEL N/A")</span>"
|
||||
tooltip="$(markup_escape "$MOUNT is NOT mounted")"
|
||||
printf '{"text":"%s","tooltip":"%s","class":"unmounted"}\n' \
|
||||
"$(json_escape "$text")" "$(json_escape "$tooltip")"
|
||||
|
||||
Reference in New Issue
Block a user