Regenerated
This commit is contained in:
+315
-323
File diff suppressed because it is too large
Load Diff
+11
-19
@@ -2998,27 +2998,19 @@ 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
|
||||||
# ~/.config/waybar/scripts/hypr-workspaces.sh
|
# Get active workspace clients (example using hyprctl)
|
||||||
# Get active workspace ID
|
|
||||||
active_ws=$(hyprctl activeworkspace -j | jq -r '.id')
|
active_ws=$(hyprctl activeworkspace -j | jq -r '.id')
|
||||||
# Get clients in active workspace
|
clients=$(hyprctl clients -j | jq -r --argjson ws "$active_ws" '.[] | select(.workspace == $ws) | .title')
|
||||||
clients=$(hyprctl clients -j | jq -r \
|
# If no clients, output empty string (will hide)
|
||||||
".[] | select(.workspace.id==$active_ws) | \"\(.title)\"")
|
if [ -z "$clients" ]; then
|
||||||
# Count clients
|
echo '{"text": ""}'
|
||||||
count=$(echo "$clients" | grep -c .)
|
exit 0
|
||||||
# If no clients → hide module
|
|
||||||
if [ "$count" -eq 0 ]; then
|
|
||||||
jq -c -n '{text:"", class:"hidden"}'
|
|
||||||
exit 0
|
|
||||||
fi
|
fi
|
||||||
# Build tooltip (newline separated)
|
# Output the client list as plain text (Waybar will apply CSS)
|
||||||
tooltip=$(echo "$clients" | sed 's/^/• /' | paste -sd '\n' -)
|
# Replace newlines with commas if you want inline display
|
||||||
# Output JSON
|
client_list=$(echo "$clients" | paste -sd ", " -)
|
||||||
jq -c -n \
|
# Wrap in JSON with Pango markup for styling (avoid <button>!)
|
||||||
--arg text "$count" \
|
echo "{\"text\": \"$client_list\"}"
|
||||||
--arg tooltip "$tooltip" \
|
|
||||||
--arg class "active" \
|
|
||||||
'{text:$text, tooltip:$tooltip, class:$class}'
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** =.config/waybar/scripts/hypr-workspacesmenu.sh=
|
** =.config/waybar/scripts/hypr-workspacesmenu.sh=
|
||||||
|
|||||||
@@ -1,22 +1,14 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# ~/.config/waybar/scripts/hypr-workspaces.sh
|
# Get active workspace clients (example using hyprctl)
|
||||||
# Get active workspace ID
|
|
||||||
active_ws=$(hyprctl activeworkspace -j | jq -r '.id')
|
active_ws=$(hyprctl activeworkspace -j | jq -r '.id')
|
||||||
# Get clients in active workspace
|
clients=$(hyprctl clients -j | jq -r --argjson ws "$active_ws" '.[] | select(.workspace == $ws) | .title')
|
||||||
clients=$(hyprctl clients -j | jq -r \
|
# If no clients, output empty string (will hide)
|
||||||
".[] | select(.workspace.id==$active_ws) | \"\(.title)\"")
|
if [ -z "$clients" ]; then
|
||||||
# Count clients
|
echo '{"text": ""}'
|
||||||
count=$(echo "$clients" | grep -c .)
|
exit 0
|
||||||
# If no clients → hide module
|
|
||||||
if [ "$count" -eq 0 ]; then
|
|
||||||
jq -c -n '{text:"", class:"hidden"}'
|
|
||||||
exit 0
|
|
||||||
fi
|
fi
|
||||||
# Build tooltip (newline separated)
|
# Output the client list as plain text (Waybar will apply CSS)
|
||||||
tooltip=$(echo "$clients" | sed 's/^/• /' | paste -sd '\n' -)
|
# Replace newlines with commas if you want inline display
|
||||||
# Output JSON
|
client_list=$(echo "$clients" | paste -sd ", " -)
|
||||||
jq -c -n \
|
# Wrap in JSON with Pango markup for styling (avoid <button>!)
|
||||||
--arg text "$count" \
|
echo "{\"text\": \"$client_list\"}"
|
||||||
--arg tooltip "$tooltip" \
|
|
||||||
--arg class "active" \
|
|
||||||
'{text:$text, tooltip:$tooltip, class:$class}'
|
|
||||||
|
|||||||
Reference in New Issue
Block a user