From 849bb43a7e6789867f5ca6ec68b76042051e532c Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Wed, 13 May 2026 13:43:20 +0100 Subject: 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. --- dot_config/mako/config | 1 + dot_config/waybar/executable_mako-history.sh | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'dot_config') diff --git a/dot_config/mako/config b/dot_config/mako/config index 161f357..b954072 100644 --- a/dot_config/mako/config +++ b/dot_config/mako/config @@ -9,6 +9,7 @@ margin=4 width=300 default-timeout=5000 anchor=top-right +max-history=50 [urgency=low] border-color=#8ec07c 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 -- cgit v1.3.1