Regenerated

This commit is contained in:
2026-04-02 23:42:46 +02:00
parent cee2dd67b3
commit b5c97bf5fd
4 changed files with 338 additions and 399 deletions
+316 -339
View File
File diff suppressed because it is too large Load Diff
+12 -33
View File
@@ -2685,7 +2685,7 @@ These are config files for waybar
"exec": "~/.config/waybar/scripts/hypr-workspaces.sh", "exec": "~/.config/waybar/scripts/hypr-workspaces.sh",
"interval": 2, "interval": 2,
"return-type": "json", "return-type": "json",
"format": "{name}", "format": "{text}",
"on-click": "~/.config/waybar/scripts/hypr-workspacesmenu.sh", "on-click": "~/.config/waybar/scripts/hypr-workspacesmenu.sh",
"tooltip": true "tooltip": true
}, },
@@ -2836,7 +2836,7 @@ window#waybar {
linear-gradient(45deg, @blue, @green) border-box; linear-gradient(45deg, @blue, @green) border-box;
} }
/* Hyprland Workspaces module */ /* Hyprland workspaces with transparency */
#custom-hypr-workspaces { #custom-hypr-workspaces {
display: flex; display: flex;
gap: 4px; gap: 4px;
@@ -2847,17 +2847,13 @@ window#waybar {
border-radius: 10px; border-radius: 10px;
min-width: 50px; min-width: 50px;
text-align: center; text-align: center;
background: linear-gradient(45deg, @blue, @green); background: linear-gradient(45deg, rgba(51,204,255,0.5), rgba(0,255,153,0.5)); /* @blue with 50% opacity */
color: @text; color: @text;
font-weight: bold; font-weight: bold;
cursor: pointer; cursor: pointer;
transition: all 0.2s ease; transition: all 0.2s ease;
} }
#custom-hypr-workspaces > *:hover {
background: linear-gradient(45deg, @green, @blue);
}
#clock, #clock,
#idle_inhibitor, #idle_inhibitor,
#battery, #battery,
@@ -2943,45 +2939,28 @@ printf '{"text": "%s", "tooltip": "%s"}\n' "$icon" "$tooltip"
** =.config/waybar/scripts/hypr-workspaces.sh= ** =.config/waybar/scripts/hypr-workspaces.sh=
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
#!/bin/bash #!/usr/bin/env bash
# Outputs JSON for Waybar showing workspace name + number of windows
# Get all workspaces
# Using hyprctl JSON output
workspaces=$(hyprctl workspaces -j) workspaces=$(hyprctl workspaces -j)
# Initialize output JSON
json="[" json="["
index=0 index=0
for ws in $(echo "$workspaces" | jq -r '.[] | @base64'); do for ws in $(echo "$workspaces" | jq -r '.[] | @base64'); do
_jq() { _jq() { echo "$ws" | base64 --decode | jq -r "$1"; }
echo "$ws" | base64 --decode | jq -r "$1"
}
ws_id=$(_jq '.id') ws_id=$(_jq '.id')
ws_name=$(_jq '.name') ws_name=$(_jq '.name')
# Get windows in this workspace # Count windows in this workspace
windows=$(hyprctl clients -j | jq -r ".[] | select(.workspace.id==$ws_id) | \"\(.id): \(.title)\"") win_count=$(hyprctl clients -j | jq "[.[] | select(.workspace.id==$ws_id)] | length")
# Format tooltip: sequential numbering # Output JSON
tooltip=""
count=1
while read -r win; do
tooltip+="$count. $win\n"
count=$((count+1))
done <<< "$windows"
# If no windows
if [ -z "$tooltip" ]; then
tooltip="No windows"
fi
# Output JSON for Waybar
json+=$(jq -n \ json+=$(jq -n \
--arg name "$ws_name" \ --arg text "$ws_name ($win_count)" \
--arg tooltip "$tooltip" \ --arg tooltip "$(bash ~/.config/waybar/scripts/hypr-workspacesmenu.sh $ws_id)" \
'{text: $name, tooltip: $tooltip}') '{text: $text, tooltip: $tooltip}')
index=$((index+1)) index=$((index+1))
[ $index -lt $(echo "$workspaces" | jq length) ] && json+="," [ $index -lt $(echo "$workspaces" | jq length) ] && json+=","
+1 -1
View File
@@ -26,7 +26,7 @@
"exec": "~/.config/waybar/scripts/hypr-workspaces.sh", "exec": "~/.config/waybar/scripts/hypr-workspaces.sh",
"interval": 2, "interval": 2,
"return-type": "json", "return-type": "json",
"format": "{name}", "format": "{text}",
"on-click": "~/.config/waybar/scripts/hypr-workspacesmenu.sh", "on-click": "~/.config/waybar/scripts/hypr-workspacesmenu.sh",
"tooltip": true "tooltip": true
}, },
@@ -1,42 +1,25 @@
#!/bin/bash #!/usr/bin/env bash
# Outputs JSON for Waybar showing workspace name + number of windows
# Get all workspaces
# Using hyprctl JSON output
workspaces=$(hyprctl workspaces -j) workspaces=$(hyprctl workspaces -j)
# Initialize output JSON
json="[" json="["
index=0 index=0
for ws in $(echo "$workspaces" | jq -r '.[] | @base64'); do for ws in $(echo "$workspaces" | jq -r '.[] | @base64'); do
_jq() { _jq() { echo "$ws" | base64 --decode | jq -r "$1"; }
echo "$ws" | base64 --decode | jq -r "$1"
}
ws_id=$(_jq '.id') ws_id=$(_jq '.id')
ws_name=$(_jq '.name') ws_name=$(_jq '.name')
# Get windows in this workspace # Count windows in this workspace
windows=$(hyprctl clients -j | jq -r ".[] | select(.workspace.id==$ws_id) | \"\(.id): \(.title)\"") win_count=$(hyprctl clients -j | jq "[.[] | select(.workspace.id==$ws_id)] | length")
# Format tooltip: sequential numbering # Output JSON
tooltip=""
count=1
while read -r win; do
tooltip+="$count. $win\n"
count=$((count+1))
done <<< "$windows"
# If no windows
if [ -z "$tooltip" ]; then
tooltip="No windows"
fi
# Output JSON for Waybar
json+=$(jq -n \ json+=$(jq -n \
--arg name "$ws_name" \ --arg text "$ws_name ($win_count)" \
--arg tooltip "$tooltip" \ --arg tooltip "$(bash ~/.config/waybar/scripts/hypr-workspacesmenu.sh $ws_id)" \
'{text: $name, tooltip: $tooltip}') '{text: $text, tooltip: $tooltip}')
index=$((index+1)) index=$((index+1))
[ $index -lt $(echo "$workspaces" | jq length) ] && json+="," [ $index -lt $(echo "$workspaces" | jq length) ] && json+=","