Skip to content

0.3.0

Choose a tag to compare

@yashkathe yashkathe released this 29 Apr 03:27
· 4 commits to master since this release

Update Log

Highlights:

  • Converted simple one-time reminder runner into a fully persistent, self-updating background reminder daemon with systemd user service integration.

Changes Made:

  • Initial issue

    • Reminders worked but only if scheduled at program start.
    • New tasks added after startup were ignored unless the service was restarted.
  • Root cause

    • Tasks were loaded only once at startup.
    • schedule.run_pending could only trigger jobs that were scheduled beforehand.
  • Temporary fix tested

    • Added tasks manually for 1–2 minutes in the future.
    • Restarted the service to pick up new tasks.
    • Reminders worked after restart, but the process was manual and not scalable.
  • Permanent fix implemented

    • Modified daemon.py to:
      • Continuously poll the database every second inside the main loop.
      • Track already scheduled tasks using a set.
      • Schedule only new tasks that were not already scheduled.
    • Now new reminders appear without needing to restart the service.
  • Notification not showing up issue

    • Root cause: notify2 needs a DBUS graphical session environment.
    • Solved by:
      • Moving from system-wide service to user-specific systemd service.
      • Setting environment variables inside the .service file:
        • DISPLAY=:0
        • DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%U/bus
  • Service location fixed

    • Moved the .service file to ~/.config/systemd/user/.
    • Updated the Makefile to:
      • Use systemctl --user commands.
      • Remove all sudo dependency.
    • Service now runs correctly under the user session and can send desktop notifications.
  • Final test and confirmation

    • Added a task using make add.
    • Without restarting, the new reminder triggered at the correct time.
    • Confirmed that there were no duplicate tasks and no missed triggers.
    • Background daemon now runs continuously and reliably.

Final Features After Upgrade:

  • Automatically loads new reminders without requiring a service restart.
  • Lightweight background process using schedule.run_pending loop.
  • Fully integrated with systemd user services (no root needed).
  • Desktop notifications work correctly in the graphical session.
  • Database-driven, scalable, and robust reminder scheduling.