Regenerated

This commit is contained in:
2026-04-03 16:56:15 +02:00
parent b7a85895f3
commit d3e35d652a
3 changed files with 337 additions and 361 deletions
+11 -19
View File
@@ -2998,27 +2998,19 @@ printf '{"text": "%s", "tooltip": "%s"}\n' "$icon" "$tooltip"
These are config files for waybar
#+BEGIN_SRC sh :tangle generated/.config/waybar/scripts/hypr-workspaces.sh :noweb yes :mkdirp yes :eval never
#!/usr/bin/env bash
# ~/.config/waybar/scripts/hypr-workspaces.sh
# Get active workspace ID
# Get active workspace clients (example using hyprctl)
active_ws=$(hyprctl activeworkspace -j | jq -r '.id')
# Get clients in active workspace
clients=$(hyprctl clients -j | jq -r \
".[] | select(.workspace.id==$active_ws) | \"\(.title)\"")
# Count clients
count=$(echo "$clients" | grep -c .)
# If no clients → hide module
if [ "$count" -eq 0 ]; then
jq -c -n '{text:"", class:"hidden"}'
exit 0
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
# Build tooltip (newline separated)
tooltip=$(echo "$clients" | sed 's/^/• /' | paste -sd '\n' -)
# Output JSON
jq -c -n \
--arg text "$count" \
--arg tooltip "$tooltip" \
--arg class "active" \
'{text:$text, tooltip:$tooltip, class:$class}'
# 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\"}"
#+END_SRC
** =.config/waybar/scripts/hypr-workspacesmenu.sh=