#!/usr/bin/env bash set -euo pipefail if ! command -v i3-msg >/dev/null 2>&1 || ! command -v jq >/dev/null 2>&1; then echo "n/a" exit 0 fi count="$( i3-msg -t get_tree 2>/dev/null | jq '[.. | objects | select(.name == "__i3_scratch") | .floating_nodes[]?] | length' 2>/dev/null || printf '0' )" if [ "$count" -gt 0 ] 2>/dev/null; then echo "%{F#d79921}$count%{F-}" else echo "0" fi