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
|
||||
#+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=
|
||||
|
||||
@@ -1,22 +1,14 @@
|
||||
#!/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\"}"
|
||||
|
||||
Reference in New Issue
Block a user