Regenerated

This commit is contained in:
2026-04-02 22:25:30 +02:00
parent f590823cda
commit 0b543b4017
7 changed files with 574 additions and 372 deletions
@@ -0,0 +1,46 @@
#!/bin/bash
# Get all workspaces
# Using hyprctl JSON output
workspaces=$(hyprctl workspaces -j)
# Initialize output JSON
json="["
index=0
for ws in $(echo "$workspaces" | jq -r '.[] | @base64'); do
_jq() {
echo "$ws" | base64 --decode | jq -r "$1"
}
ws_id=$(_jq '.id')
ws_name=$(_jq '.name')
# Get windows in this workspace
windows=$(hyprctl clients -j | jq -r ".[] | select(.workspace.id==$ws_id) | \"\(.id): \(.title)\"")
# Format tooltip: sequential numbering
tooltip=""
count=1
while read -r win; do
tooltip+="$count. $win\n"
count=$((count+1))
done <<< "$windows"
# If no windows
if [ -z "$tooltip" ]; then
tooltip="No windows"
fi
# Output JSON for Waybar
json+=$(jq -n \
--arg name "$ws_name" \
--arg tooltip "$tooltip" \
'{text: $name, tooltip: $tooltip}')
index=$((index+1))
[ $index -lt $(echo "$workspaces" | jq length) ] && json+=","
done
json+="]"
echo "$json"
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
active_ws=$(hyprctl activeworkspace -j | jq -r '.id')
clients=$(hyprctl clients -j | jq -r \
".[] | select(.workspace.id==$active_ws) | \"\(.address)|\(.title)\"")
choice=$(echo "$clients" | cut -d'|' -f2 | wofi -dmenu -j -p "Windows")
[ -z "$choice" ] && exit 0
addr=$(echo "$clients" | grep "|$choice" | head -n1 | cut -d'|' -f1)
hyprctl dispatch focuswindow address:$addr