15 lines
620 B
Bash
Executable File
15 lines
620 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Get active workspace clients (example using hyprctl)
|
|
active_ws=$(hyprctl activeworkspace -j | jq -r '.id')
|
|
clients=$(hyprctl clients -j | jq -r --argjson ws "$active_ws" '.[] | select(.workspace == $ws) | .title')
|
|
# If no clients, output empty string (will hide)
|
|
if [ -z "$clients" ]; then
|
|
echo '{"text": ""}'
|
|
exit 0
|
|
fi
|
|
# Output the client list as plain text (Waybar will apply CSS)
|
|
# Replace newlines with commas if you want inline display
|
|
client_list=$(echo "$clients" | paste -sd ", " -)
|
|
# Wrap in JSON with Pango markup for styling (avoid <button>!)
|
|
echo "{\"text\": \"$client_list\"}"
|