Regenerated
This commit is contained in:
+332
-326
File diff suppressed because it is too large
Load Diff
+12
-6
@@ -3574,20 +3574,26 @@ printf '{"text": "%s", "tooltip": "%s"}\n' "$icon" "$tooltip"
|
|||||||
These are config files for waybar
|
These are config files for waybar
|
||||||
#+BEGIN_SRC sh :tangle generated/.config/waybar/scripts/hypr-workspaces.sh :noweb yes :mkdirp yes :eval never
|
#+BEGIN_SRC sh :tangle generated/.config/waybar/scripts/hypr-workspaces.sh :noweb yes :mkdirp yes :eval never
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Get active workspace ID
|
|
||||||
active_ws=$(hyprctl activeworkspace -j | jq -r '.id')
|
# Get the focused monitor's active workspace
|
||||||
# Get clients in active workspace
|
focused_ws=$(hyprctl activeworkspace -j | jq -r '.id')
|
||||||
|
|
||||||
|
# Get clients in focused workspace
|
||||||
clients=$(hyprctl clients -j | jq -r \
|
clients=$(hyprctl clients -j | jq -r \
|
||||||
".[] | select(.workspace.id==$active_ws) | \"\(.title)\"")
|
".[] | select(.workspace.id==$focused_ws) | \"\(.title)\"")
|
||||||
# Count clients
|
|
||||||
|
# Count clients (only non-empty lines)
|
||||||
count=$(echo "$clients" | grep -c '\S')
|
count=$(echo "$clients" | grep -c '\S')
|
||||||
|
|
||||||
# If no clients → hide module
|
# If no clients → hide module
|
||||||
if [ "$count" -eq 0 ]; then
|
if [ "$count" -eq 0 ]; then
|
||||||
jq -c -n '{text:"", class:"hidden"}'
|
jq -c -n '{text:"", class:"hidden"}'
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
# Build tooltip (newline separated)
|
|
||||||
|
# Build tooltip
|
||||||
tooltip=$(echo "$clients" | sed 's/^/• /' | paste -sd '\n' -)
|
tooltip=$(echo "$clients" | sed 's/^/• /' | paste -sd '\n' -)
|
||||||
|
|
||||||
# Output JSON
|
# Output JSON
|
||||||
jq -c -n \
|
jq -c -n \
|
||||||
--arg text "$count" \
|
--arg text "$count" \
|
||||||
|
|||||||
@@ -1,18 +1,24 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Get active workspace ID
|
|
||||||
active_ws=$(hyprctl activeworkspace -j | jq -r '.id')
|
# Get the focused monitor's active workspace
|
||||||
# Get clients in active workspace
|
focused_ws=$(hyprctl activeworkspace -j | jq -r '.id')
|
||||||
|
|
||||||
|
# Get clients in focused workspace
|
||||||
clients=$(hyprctl clients -j | jq -r \
|
clients=$(hyprctl clients -j | jq -r \
|
||||||
".[] | select(.workspace.id==$active_ws) | \"\(.title)\"")
|
".[] | select(.workspace.id==$focused_ws) | \"\(.title)\"")
|
||||||
# Count clients
|
|
||||||
|
# Count clients (only non-empty lines)
|
||||||
count=$(echo "$clients" | grep -c '\S')
|
count=$(echo "$clients" | grep -c '\S')
|
||||||
|
|
||||||
# If no clients → hide module
|
# If no clients → hide module
|
||||||
if [ "$count" -eq 0 ]; then
|
if [ "$count" -eq 0 ]; then
|
||||||
jq -c -n '{text:"", class:"hidden"}'
|
jq -c -n '{text:"", class:"hidden"}'
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
# Build tooltip (newline separated)
|
|
||||||
|
# Build tooltip
|
||||||
tooltip=$(echo "$clients" | sed 's/^/• /' | paste -sd '\n' -)
|
tooltip=$(echo "$clients" | sed 's/^/• /' | paste -sd '\n' -)
|
||||||
|
|
||||||
# Output JSON
|
# Output JSON
|
||||||
jq -c -n \
|
jq -c -n \
|
||||||
--arg text "$count" \
|
--arg text "$count" \
|
||||||
|
|||||||
Reference in New Issue
Block a user