Regenerated

This commit is contained in:
2026-04-01 20:03:58 +02:00
parent 8305a97c08
commit 47414e1f7b
3 changed files with 377 additions and 387 deletions
+318 -321
View File
File diff suppressed because it is too large Load Diff
+30 -33
View File
@@ -3029,45 +3029,42 @@ These are config files for waybar
#+BEGIN_SRC sh :tangle generated/.config/waybar/scripts/hyprscroll-overflow.sh :noweb yes :mkdirp yes :eval never #+BEGIN_SRC sh :tangle generated/.config/waybar/scripts/hyprscroll-overflow.sh :noweb yes :mkdirp yes :eval never
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
# Fallback JSON (hidden)
fallback='{"text":" ","class":"hidden"}' fallback='{"text":" ","class":"hidden"}'
# Get active workspace ID # Get active workspace ID
active_ws=$(hyprctl activeworkspace -j 2>/dev/null | jq -r '.id') || { active_ws=$(hyprctl activeworkspace -j | jq '.id') || { echo "$fallback"; exit 0; }
echo "$fallback"
exit 0 # Get all clients on this workspace
} ws_clients=$(hyprctl clients -j | jq "[.[] | select(.workspace.id==$active_ws)]")
# Get all clients on the active workspace total_clients=$(echo "$ws_clients" | jq 'length')
clients=$(hyprctl clients -j 2>/dev/null | jq "[.[] | select(.workspace.id==$active_ws)]") || { (( total_clients == 0 )) && { echo "$fallback"; exit 0; }
echo "$fallback"
exit 0 # Get all monitors
} monitors=$(hyprctl monitors -j)
# Count total windows
count=$(echo "$clients" | jq 'length') # Count windows that are fully inside any monitor
# Get monitor geometry for active workspace visible_count=$(jq -n --argjson clients "$ws_clients" --argjson monitors "$monitors" '
monitor=$(hyprctl monitors -j 2>/dev/null | jq -r ".[] | select(.activeWorkspace==$active_ws)") ($clients[] | select(
if [[ -z "$monitor" ]]; then ($monitors[] |
echo "$fallback" .x <= .at[0] and (.at[0] + .size[0]) <= (.x + .width) and
exit 0 .y <= .at[1] and (.at[1] + .size[1]) <= (.y + .height)
fi )
mon_width=$(echo "$monitor" | jq '.width') )) | length
mon_height=$(echo "$monitor" | jq '.height')
# Calculate number of windows that are actually visible on screen
# Assume a window is visible if its top-left corner is inside monitor bounds
visible_count=$(echo "$clients" | jq --argjson mw "$mon_width" --argjson mh "$mon_height" '
map(select(
.at[0] >= 0 and .at[0] < $mw and
.at[1] >= 0 and .at[1] < $mh
)) | length
') ')
# Show fallback if all windows are already visible
if (( count <= visible_count )); then # Show fallback if all windows fit
if (( total_clients <= visible_count )); then
echo "$fallback" echo "$fallback"
exit 0 exit 0
fi fi
# Build tooltip from window titles (escaped)
tooltip=$(echo "$clients" | jq -r '.[].title' | sed ':a;N;$!ba;s/\n/\\n/g') # Build tooltip
# Output JSON for Waybar tooltip=$(echo "$ws_clients" | jq -r '.[].title' | sed ':a;N;$!ba;s/\n/\\n/g')
echo "{\"text\":\"★ $count\",\"tooltip\":\"$tooltip\",\"class\":\"overflow\"}"
# Output JSON
echo "{\"text\":\"★ $total_clients\",\"tooltip\":\"$tooltip\",\"class\":\"overflow\"}"
#+END_SRC #+END_SRC
** =.config/waybar/scripts/hyprscroll-menu.sh= ** =.config/waybar/scripts/hyprscroll-menu.sh=
@@ -1,41 +1,37 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
# Fallback JSON (hidden)
fallback='{"text":" ","class":"hidden"}' fallback='{"text":" ","class":"hidden"}'
# Get active workspace ID # Get active workspace ID
active_ws=$(hyprctl activeworkspace -j 2>/dev/null | jq -r '.id') || { active_ws=$(hyprctl activeworkspace -j | jq '.id') || { echo "$fallback"; exit 0; }
echo "$fallback"
exit 0 # Get all clients on this workspace
} ws_clients=$(hyprctl clients -j | jq "[.[] | select(.workspace.id==$active_ws)]")
# Get all clients on the active workspace total_clients=$(echo "$ws_clients" | jq 'length')
clients=$(hyprctl clients -j 2>/dev/null | jq "[.[] | select(.workspace.id==$active_ws)]") || { (( total_clients == 0 )) && { echo "$fallback"; exit 0; }
echo "$fallback"
exit 0 # Get all monitors
} monitors=$(hyprctl monitors -j)
# Count total windows
count=$(echo "$clients" | jq 'length') # Count windows that are fully inside any monitor
# Get monitor geometry for active workspace visible_count=$(jq -n --argjson clients "$ws_clients" --argjson monitors "$monitors" '
monitor=$(hyprctl monitors -j 2>/dev/null | jq -r ".[] | select(.activeWorkspace==$active_ws)") ($clients[] | select(
if [[ -z "$monitor" ]]; then ($monitors[] |
echo "$fallback" .x <= .at[0] and (.at[0] + .size[0]) <= (.x + .width) and
exit 0 .y <= .at[1] and (.at[1] + .size[1]) <= (.y + .height)
fi )
mon_width=$(echo "$monitor" | jq '.width') )) | length
mon_height=$(echo "$monitor" | jq '.height')
# Calculate number of windows that are actually visible on screen
# Assume a window is visible if its top-left corner is inside monitor bounds
visible_count=$(echo "$clients" | jq --argjson mw "$mon_width" --argjson mh "$mon_height" '
map(select(
.at[0] >= 0 and .at[0] < $mw and
.at[1] >= 0 and .at[1] < $mh
)) | length
') ')
# Show fallback if all windows are already visible
if (( count <= visible_count )); then # Show fallback if all windows fit
if (( total_clients <= visible_count )); then
echo "$fallback" echo "$fallback"
exit 0 exit 0
fi fi
# Build tooltip from window titles (escaped)
tooltip=$(echo "$clients" | jq -r '.[].title' | sed ':a;N;$!ba;s/\n/\\n/g') # Build tooltip
# Output JSON for Waybar tooltip=$(echo "$ws_clients" | jq -r '.[].title' | sed ':a;N;$!ba;s/\n/\\n/g')
echo "{\"text\":\"★ $count\",\"tooltip\":\"$tooltip\",\"class\":\"overflow\"}"
# Output JSON
echo "{\"text\":\"★ $total_clients\",\"tooltip\":\"$tooltip\",\"class\":\"overflow\"}"