Preventing empty overflow

This commit is contained in:
2026-02-27 22:11:51 +01:00
parent 7234973f01
commit 697cb75b2c
@@ -114,20 +114,14 @@ if [[ "${1:-}" == "--pick" ]]; then
exit 0
fi
# Status JSON for Waybar
# Make it ALWAYS visible so you can hover to see the list.
# Show +N only when overflow AND layout==scrolling, keeping your original intent.
text="$ICON"
cls="ok"
if (( overflow > 0 )) && [[ "$layout" == "scrolling" ]]; then
text="$ICON +$overflow"
cls="overflow"
elif (( overflow == 0 )) || [[ "$layout" != "scrolling" ]]; then
# Tell Waybar to hide the module
if (( overflow == 0 )) || [[ "$layout" != "scrolling" ]]; then
printf '{"text":""}\n'
exit 0
fi
text="$ICON +$overflow"
cls="overflow"
tooltip="WS ${focused_ws_id}${win_count} window(s)\n"
tooltip+="Approx ${max_visible} fit (column_width=${COLUMN_WIDTH})\n"
tooltip+="------------------------------\n"