A small D-Bus listener that watches for notifications, filters by app name and sender, and logs matches to a plain-text file as a persistent systemd user service.

Stars

44

7-day growth

No data

Forks

11

Open issues

0

License

No data

Last updated

2026-07-08

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It provides a lightweight, minimal-dependency solution for selectively logging desktop notifications with automatic restart and persistence across logouts and reboots.

Who it is for

  • Linux users who want to log specific app notifications
  • System administrators monitoring notification activity
  • Privacy-conscious users auditing notification senders
  • Developers needing a simple notification logging tool

Use cases

  • Logging messages from a specific messaging app (e.g., WhatsApp) to a file
  • Auditing notification senders and timestamps for personal tracking
  • Persistent notification monitoring across reboots without manual intervention
  • Testing and debugging notification behavior of desktop applications

Strengths

  • Simple build with only libdbus-1 dependency and a single C source file
  • Persistent via systemd user service with automatic restart on failure
  • Human-readable log output with timestamp, sender, and body
  • Supports optional lingering to run even before user login

Considerations

  • Relies on D-Bus eavesdrop policy which may be blocked by restrictive session bus configurations
  • Only matches notifications by app name and summary field; does not parse the hints dict for more reliable sender identification
  • Currently hardcoded to filter by a single app and sender; modifying requires editing the systemd unit file

README quick start

Build & Install

A small D-Bus listener that watches for org.freedesktop.Notifications.Notify calls, filters by app name + sender, and appends matches to a plain-text log file in a human-readable [timestamp] Sender: body format. Runs as a persistent systemd user service so it survives logouts/reboots.

1. Dependencies

Debian/Ubuntu:

sudo apt install build-essential pkg-config libdbus-1-dev

Fedora:

sudo dnf install gcc pkgconf-pkg-config dbus-devel

Arch:

sudo pacman -S base-devel dbus

2. Build

make

Or manually:

gcc -O2 -Wall -Wextra -o build/notify_logger logger.c $(pkg-config --cflags --libs dbus-1)

Test it manually first (Ctrl+C to stop):

./notify_logger --app whatsapp-linux-app --sender Name --out ./matches.log

Send yourself a test notification, or wait for a real one, and confirm a line appears in matches.log and on stdout, e.g.:

[2026-07-08 14:32:10] Name : hey, are you around?

If nothing shows up, see Troubleshooting below (eavesdrop policy).

3. Install as a persistent user service (systemd)

make install
mkdir -p ~/notify_logger ~/.config/systemd/user
cp logger.service ~/.config/systemd/user/notify-logger.service

systemctl --user daemon-reload
systemctl --user enable --now notify-logger.service

This makes it:

  • Start automatically on login (WantedBy=default.target)
  • Restart automatically if it crashes (Restart=on-failure)
  • Log matches to ~/notify_logger/matches.log

Check status / logs:

systemctl --user status notify-logger.service
journalctl --user -u notify-logger.service -f

To change the target app/sender/output path, edit the ExecStart= line in ~/.config/systemd/user/notify-logger.service, then:

systemctl --user daemon-reload
systemctl --user restart notify-logger.service

Optional: survive reboot even when not logged in

By default, user systemd units only run once you're logged in (or after a graphical session starts, per After=graphical-session.target in the unit). If you want it running even before login (e.g. on headless boot), enable lingering:

loginctl enable-linger $USER

4. Uninstall

systemctl --user disable --now notify-logger.service
rm ~/.config/systemd/user/notify-logger.service
rm ~/.local/bin/notify_logger
systemctl --user daemon-re

Description

A small D-Bus listener that watches for notify calls, filters by app name + sender, and appends matches to a plain-text log file in a human-readable format.

Related repositories

Similar projects matched by category, topics, and programming language.

Infatoshi
Featured
Infatoshi GitHub avatar

netherite

A from-scratch C/CUDA reimplementation of Minecraft 1.11.2 that is bit-verified against the original Java game and includes batched CUDA reinforcement learning support.

AI & Machine LearningLarge Language Models
223
nsdkinx
Featured
nsdkinx GitHub avatar

twell

Twell is a tiny, embeddable, zero-allocation physics engine for interruptible, Apple-style UI animations, available as a single-header C library with Python bindings.

MobileDesign & Creative
17
sqliteai
Featured
sqliteai GitHub avatar

waste

WASTE is a C-based inference engine that streams MoE experts from disk to run a 2.78 trillion-parameter model on a consumer laptop with 64 GB RAM.

Data & DatabasesData Engineering
14