aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/dot_config/waybar
diff options
context:
space:
mode:
authorLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-13 13:43:20 +0100
committerLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-13 13:43:20 +0100
commit849bb43a7e6789867f5ca6ec68b76042051e532c (patch)
treee0b9cf7c572f650fbaed3edabc70064e66ff29d3 /dot_config/waybar
parent6cb90800c7fd94712f2dd7860863813de3f0ae30 (diff)
downloaddotfiles-849bb43a7e6789867f5ca6ec68b76042051e532c.tar.gz
dotfiles-849bb43a7e6789867f5ca6ec68b76042051e532c.tar.bz2
dotfiles-849bb43a7e6789867f5ca6ec68b76042051e532c.zip
fix(waybar): tolerant jq for mako history + bump max-history to 50
Previous jq path (.data[0][].summary.data) only works for one nesting shape of mako's history JSON. Recurse to find notification objects and unwrap dbus-typed {type,data} fields defensively. Also bump max-history from the default of 5 so more entries are retained.
Diffstat (limited to 'dot_config/waybar')
-rwxr-xr-xdot_config/waybar/executable_mako-history.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/dot_config/waybar/executable_mako-history.sh b/dot_config/waybar/executable_mako-history.sh
index 046f555..4c0ec3a 100755
--- a/dot_config/waybar/executable_mako-history.sh
+++ b/dot_config/waybar/executable_mako-history.sh
@@ -7,9 +7,12 @@
set -eu
selection=$(
- makoctl history |
- jq -r '.data[0][] | "[\(.["app-name"].data)] \(.summary.data) — \(.body.data)"' |
- fuzzel --dmenu --prompt 'History: '
+ makoctl history | jq -r '
+ def v: if type == "object" and has("data") then .data else . end;
+ [.. | objects | select(has("summary") and has("app-name"))]
+ | .[]
+ | "[\(.["app-name"] | v)] \(.summary | v) — \((.body | v) // "")"
+ ' | fuzzel --dmenu --prompt 'History: '
)
if [ -n "$selection" ]; then