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 a1c7a48a8..9fe9a33f2 100755 --- a/henrovnix_ok/assets/conf/desktop/hypr/scripts/hyprscroll-overflow.sh +++ b/henrovnix_ok/assets/conf/desktop/hypr/scripts/hyprscroll-overflow.sh @@ -13,6 +13,13 @@ 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":"%s 0","tooltip":"layout != scrolling","class":"ok"}\n' "$ICON" + 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 ' @@ -24,7 +31,7 @@ read -r focused_mon_id focused_ws_id < <( # Count mapped windows on that monitor+workspace win_count="$( - hyprctl -j clients 2>/dev/null | jq --argjson ws "$focused_ws_id" --argjson mid "$focused_mon_id" ' + hyprctl -j clients 2>/dev/null | jq --argjson ws it should only respond with a"$focused_ws_id" --argjson mid "$focused_mon_id" ' [ .[] | select(.mapped == true) | select(.workspace.id == $ws)