Regenerated
This commit is contained in:
+318
-311
File diff suppressed because it is too large
Load Diff
+30
-23
@@ -2635,7 +2635,7 @@ in
|
||||
|
||||
** =.config/waybar/config=
|
||||
These are config files for waybar
|
||||
#+BEGIN_SRC conf :tangle generated/.config/waybar/config :noweb yes :mkdirp yes :eval never
|
||||
#+BEGIN_SRC json :tangle generated/.config/waybar/config :noweb yes :mkdirp yes :eval never
|
||||
{
|
||||
"layer": "top",
|
||||
"height": 34,
|
||||
@@ -2660,16 +2660,17 @@ These are config files for waybar
|
||||
"battery",
|
||||
"tray",
|
||||
"clock",
|
||||
"custom/notifications",
|
||||
# "custom/notifications",
|
||||
],
|
||||
|
||||
"custom/hyprscroll_overflow": {
|
||||
"exec": "~/.config/waybar/scripts/hyprscroll-overflow.sh",
|
||||
"interval": 2,
|
||||
"return-type": "json",
|
||||
"format": "{}",
|
||||
"on-click": "~/.config/waybar/scripts/hyprscroll-menu.sh",
|
||||
"tooltip": true
|
||||
},
|
||||
},,
|
||||
|
||||
/*
|
||||
"custom/notifications": {
|
||||
@@ -2770,7 +2771,6 @@ These are config files for waybar
|
||||
"format-icons": ["", "", "", "", " "],
|
||||
},
|
||||
}
|
||||
|
||||
#+END_SRC
|
||||
|
||||
** =.config/waybar/style.css=
|
||||
@@ -3029,31 +3029,38 @@ printf '{"text": "%s", "tooltip": "%s"}\n' "$icon" "$tooltip"
|
||||
These are config files for waybar
|
||||
#+BEGIN_SRC sh :tangle generated/.config/waybar/scripts/hyprscroll-overflow.sh :noweb yes :mkdirp yes :eval never
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
# Fallback output
|
||||
fallback='{"text":" ","class":"hidden"}'
|
||||
# Get active workspace
|
||||
active_ws=$(hyprctl activeworkspace -j | jq -r '.id')
|
||||
active_ws=$(hyprctl activeworkspace -j 2>/dev/null | jq -r '.id' 2>/dev/null) || {
|
||||
echo "$fallback"
|
||||
exit 0
|
||||
}
|
||||
# Get workspace info
|
||||
ws=$(hyprctl workspaces -j | jq ".[] | select(.id==$active_ws)")
|
||||
# Layout (requires hyprscroll plugin)
|
||||
layout=$(echo "$ws" | jq -r '.layout // "unknown"')
|
||||
# Window count
|
||||
clients=$(hyprctl clients -j | jq "[.[] | select(.workspace.id==$active_ws)]")
|
||||
count=$(echo "$clients" | jq 'length')
|
||||
# Visible windows (heuristic: fullscreen or floating doesn't matter, we count all)
|
||||
# If you use hyprscroll, visible windows ≈ 1 (current focus)
|
||||
ws=$(hyprctl workspaces -j 2>/dev/null | jq ".[] | select(.id==$active_ws)" 2>/dev/null) || {
|
||||
echo "$fallback"
|
||||
exit 0
|
||||
}
|
||||
# Layout
|
||||
layout=$(echo "$ws" | jq -r '.layout // "unknown"' 2>/dev/null)
|
||||
# Clients
|
||||
clients=$(hyprctl clients -j 2>/dev/null | jq "[.[] | select(.workspace.id==$active_ws)]" 2>/dev/null) || {
|
||||
echo "$fallback"
|
||||
exit 0
|
||||
}
|
||||
count=$(echo "$clients" | jq 'length' 2>/dev/null)
|
||||
# In scrolling layout, only 1 is visible
|
||||
visible=1
|
||||
# Build tooltip (list all windows)
|
||||
tooltip=$(echo "$clients" | jq -r '.[].title' | sed ':a;N;$!ba;s/\n/\\n/g')
|
||||
# Conditions
|
||||
if [[ "$layout" != "scrolling" ]]; then
|
||||
echo '{"text": "", "class": "hidden"}'
|
||||
if [[ "$layout" != "scrolling" ]] || (( count <= visible )); then
|
||||
echo "$fallback"
|
||||
exit 0
|
||||
fi
|
||||
if (( count <= visible )); then
|
||||
echo '{"text": "", "class": "hidden"}'
|
||||
exit 0
|
||||
fi
|
||||
# Output star + count
|
||||
echo "{\"text\": \"★ $count\", \"tooltip\": \"$tooltip\", \"class\": \"overflow\"}"
|
||||
# Tooltip (safe escaping)
|
||||
tooltip=$(echo "$clients" | jq -r '.[].title' 2>/dev/null | sed ':a;N;$!ba;s/\n/\\n/g')
|
||||
# Final output
|
||||
echo "{\"text\":\"★ $count\",\"tooltip\":\"$tooltip\",\"class\":\"overflow\"}"
|
||||
#+END_SRC
|
||||
|
||||
** =.config/waybar/scripts/hyprscroll-menu.sh=
|
||||
|
||||
@@ -22,16 +22,17 @@
|
||||
"battery",
|
||||
"tray",
|
||||
"clock",
|
||||
"custom/notifications",
|
||||
# "custom/notifications",
|
||||
],
|
||||
|
||||
"custom/hyprscroll_overflow": {
|
||||
"exec": "~/.config/waybar/scripts/hyprscroll-overflow.sh",
|
||||
"interval": 2,
|
||||
"return-type": "json",
|
||||
"format": "{}",
|
||||
"on-click": "~/.config/waybar/scripts/hyprscroll-menu.sh",
|
||||
"tooltip": true
|
||||
},
|
||||
},,
|
||||
|
||||
/*
|
||||
"custom/notifications": {
|
||||
|
||||
@@ -1,26 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
# Fallback output
|
||||
fallback='{"text":" ","class":"hidden"}'
|
||||
# Get active workspace
|
||||
active_ws=$(hyprctl activeworkspace -j | jq -r '.id')
|
||||
active_ws=$(hyprctl activeworkspace -j 2>/dev/null | jq -r '.id' 2>/dev/null) || {
|
||||
echo "$fallback"
|
||||
exit 0
|
||||
}
|
||||
# Get workspace info
|
||||
ws=$(hyprctl workspaces -j | jq ".[] | select(.id==$active_ws)")
|
||||
# Layout (requires hyprscroll plugin)
|
||||
layout=$(echo "$ws" | jq -r '.layout // "unknown"')
|
||||
# Window count
|
||||
clients=$(hyprctl clients -j | jq "[.[] | select(.workspace.id==$active_ws)]")
|
||||
count=$(echo "$clients" | jq 'length')
|
||||
# Visible windows (heuristic: fullscreen or floating doesn't matter, we count all)
|
||||
# If you use hyprscroll, visible windows ≈ 1 (current focus)
|
||||
ws=$(hyprctl workspaces -j 2>/dev/null | jq ".[] | select(.id==$active_ws)" 2>/dev/null) || {
|
||||
echo "$fallback"
|
||||
exit 0
|
||||
}
|
||||
# Layout
|
||||
layout=$(echo "$ws" | jq -r '.layout // "unknown"' 2>/dev/null)
|
||||
# Clients
|
||||
clients=$(hyprctl clients -j 2>/dev/null | jq "[.[] | select(.workspace.id==$active_ws)]" 2>/dev/null) || {
|
||||
echo "$fallback"
|
||||
exit 0
|
||||
}
|
||||
count=$(echo "$clients" | jq 'length' 2>/dev/null)
|
||||
# In scrolling layout, only 1 is visible
|
||||
visible=1
|
||||
# Build tooltip (list all windows)
|
||||
tooltip=$(echo "$clients" | jq -r '.[].title' | sed ':a;N;$!ba;s/\n/\\n/g')
|
||||
# Conditions
|
||||
if [[ "$layout" != "scrolling" ]]; then
|
||||
echo '{"text": "", "class": "hidden"}'
|
||||
if [[ "$layout" != "scrolling" ]] || (( count <= visible )); then
|
||||
echo "$fallback"
|
||||
exit 0
|
||||
fi
|
||||
if (( count <= visible )); then
|
||||
echo '{"text": "", "class": "hidden"}'
|
||||
exit 0
|
||||
fi
|
||||
# Output star + count
|
||||
echo "{\"text\": \"★ $count\", \"tooltip\": \"$tooltip\", \"class\": \"overflow\"}"
|
||||
# Tooltip (safe escaping)
|
||||
tooltip=$(echo "$clients" | jq -r '.[].title' 2>/dev/null | sed ':a;N;$!ba;s/\n/\\n/g')
|
||||
# Final output
|
||||
echo "{\"text\":\"★ $count\",\"tooltip\":\"$tooltip\",\"class\":\"overflow\"}"
|
||||
|
||||
Reference in New Issue
Block a user