dot
vizie's NixOS desktop: Hyprland, CachyOS kernel and gaming tweaks
| 1 | #!/usr/bin/env python3 |
| 2 | """Waybar module: number of notifications in dunst's history, as one JSON line per change. |
| 3 | |
| 4 | Prints an empty text when there are none, so Waybar hides the badge. Event-driven (dunst |
| 5 | announces changes to its history length over D-Bus), with a slow poll as a safety net. |
| 6 | The number is capped at what the Eww notifications panel shows. |
| 7 | """ |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | # noqa: E402 |
| 14 | |
| 15 | = 10 # keep in sync with eww/scripts/notifications.py |
| 16 | = |
| 17 | = |
| 18 | = |
| 19 | |
| 20 | = None |
| 21 | |
| 22 | |
| 23 | |
| 24 | global |
| 25 | = |
| 26 | |
| 27 | = |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | = |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | # dunst not running |
| 40 | return True |
| 41 | |
| 42 | |
| 43 | |
| 44 | = |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |