diff options
| author | 2026-05-13 13:43:29 +0100 | |
|---|---|---|
| committer | 2026-05-13 13:43:29 +0100 | |
| commit | 0a5c53a1198e9645501ec17af06478e0efb3bcc3 (patch) | |
| tree | 5dc3a98ed3a1217433da18fd078d6287c664109f /dot_config/waybar/executable_dismiss-visible.sh | |
| parent | ce97dd5d68dfca687db0bdcd5adb6add6ed45e50 (diff) | |
| download | dotfiles-0a5c53a1198e9645501ec17af06478e0efb3bcc3.tar.gz dotfiles-0a5c53a1198e9645501ec17af06478e0efb3bcc3.tar.bz2 dotfiles-0a5c53a1198e9645501ec17af06478e0efb3bcc3.zip | |
fix(waybar): dismiss/restore wrappers parse mako text format
Same -f-doesn't-exist regression as 3205afc / d76ff3c. Without -f the
inner pipeline produced no ids, so the dismissed-set never grew and
notifications stayed pending forever after Mod+n.
Switch to sed extraction of 'Notification N:' lines for both
dismiss-visible.sh (list) and restore-pending.sh (history). Verified
the dismissed-set is populated correctly for top/all modes.
Diffstat (limited to 'dot_config/waybar/executable_dismiss-visible.sh')
| -rw-r--r-- | dot_config/waybar/executable_dismiss-visible.sh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/dot_config/waybar/executable_dismiss-visible.sh b/dot_config/waybar/executable_dismiss-visible.sh index 98d240b..32d4a8a 100644 --- a/dot_config/waybar/executable_dismiss-visible.sh +++ b/dot_config/waybar/executable_dismiss-visible.sh @@ -16,14 +16,20 @@ mkdir -p "$(dirname "$state")" command -v makoctl >/dev/null 2>&1 || exit 0 +# This makoctl has no -f; extract ids from the text dump. +list_ids() { + makoctl list 2>/dev/null \ + | sed -n 's/^Notification \([0-9][0-9]*\):.*/\1/p' +} + case "$mode" in top) - id=$(makoctl list -f '%i' 2>/dev/null | head -n1 || true) + id=$(list_ids | head -n1 || true) [ -n "${id:-}" ] && printf '%s\n' "$id" >>"$state" makoctl dismiss ;; all) - makoctl list -f '%i' 2>/dev/null >>"$state" || true + list_ids >>"$state" || true makoctl dismiss --all ;; *) |
