From f7c84fb9d19261a1b8c7d0b6057e522f23121827 Mon Sep 17 00:00:00 2001 From: Henro Veijer Date: Fri, 27 Feb 2026 17:20:47 +0100 Subject: [PATCH] Different calculation --- .../desktop/hypr/scripts/hyprscroll-overflow.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/henrovnix_ok/assets/conf/desktop/hypr/scripts/hyprscroll-overflow.sh b/henrovnix_ok/assets/conf/desktop/hypr/scripts/hyprscroll-overflow.sh index a896f4dcc..718f4098d 100755 --- a/henrovnix_ok/assets/conf/desktop/hypr/scripts/hyprscroll-overflow.sh +++ b/henrovnix_ok/assets/conf/desktop/hypr/scripts/hyprscroll-overflow.sh @@ -13,14 +13,6 @@ fail_json() { command -v hyprctl >/dev/null 2>&1 || fail_json "hyprctl not in PATH" command -v jq >/dev/null 2>&1 || fail_json "jq not in PATH" -# If layout is not scrolling → respond with 0 -layout="$(hyprctl getoption general:layout 2>/dev/null | awk '/str:/ {print $2; exit}')" -if [[ "$layout" != "scrolling" ]]; then - printf '{"text":"","tooltip":"%d windows; approx %d fit","class":"ok"}\n' \ - "$win_count" "$max_visible" - exit 0 -fi - # Focused monitor id + its active workspace id (both numeric) read -r focused_mon_id focused_ws_id < <( hyprctl -j monitors 2>/dev/null | jq -r ' @@ -47,6 +39,13 @@ max_visible="$(awk -v w="$COLUMN_WIDTH" 'BEGIN{ if (w<=0) {print 1} else {print overflow=$(( win_count - max_visible )) +# If layout is not scrolling → respond with 0 +layout="$(hyprctl getoption general:layout 2>/dev/null | awk '/str:/ {print $2; exit}')" +if [[ "$layout" != "scrolling" ]]; then + overflow= 0 + exit 0 +fi + if (( overflow > 0 )); then printf '{"text":"%s +%d","tooltip":"%d windows; approx %d fit (column_width=%s)","class":"overflow"}\n' \ "$ICON" "$overflow" "$win_count" "$max_visible" "$COLUMN_WIDTH"