From 84eec8c855b2c6ff246831a361d3815146934bd5 Mon Sep 17 00:00:00 2001 From: Daniele Fucini Date: Thu, 12 Nov 2026 11:27:30 +0100 Subject: [PATCH] calcurse: notify whole-day events every morning The calcurse daemon only alerts timed appointments, so birthdays went unnoticed. A daily 09:00 timer, started from xmonad and persistent across suspend, sends today's events through notify-send. --- .config/systemd/user/calcurse-today.service | 6 ++++++ .config/systemd/user/calcurse-today.timer | 6 ++++++ .config/xmonad/xmonad.hs | 1 + .local/bin/calcurse-today | 9 +++++++++ 4 files changed, 22 insertions(+) create mode 100644 .config/systemd/user/calcurse-today.service create mode 100644 .config/systemd/user/calcurse-today.timer create mode 100755 .local/bin/calcurse-today diff --git a/.config/systemd/user/calcurse-today.service b/.config/systemd/user/calcurse-today.service new file mode 100644 index 0000000..2a8514f --- /dev/null +++ b/.config/systemd/user/calcurse-today.service @@ -0,0 +1,6 @@ +[Unit] +Description=Notify today's calcurse events + +[Service] +Type=oneshot +ExecStart=%h/.local/bin/calcurse-today diff --git a/.config/systemd/user/calcurse-today.timer b/.config/systemd/user/calcurse-today.timer new file mode 100644 index 0000000..0fc0edf --- /dev/null +++ b/.config/systemd/user/calcurse-today.timer @@ -0,0 +1,6 @@ +[Unit] +Description=Notify today's calcurse events every morning + +[Timer] +OnCalendar=*-*-* 09:00 +Persistent=true diff --git a/.config/xmonad/xmonad.hs b/.config/xmonad/xmonad.hs index 97b9aae..2bfa0b8 100644 --- a/.config/xmonad/xmonad.hs +++ b/.config/xmonad/xmonad.hs @@ -358,6 +358,7 @@ myStartupHook = do spawnOnce "nm-applet" spawnOnce "arch-audit-gtk" spawnOnce "calcurse --daemon" + spawnOnce "systemctl --user start calcurse-today.timer" spawnOnce "systemctl --user start dunst" spawnOnce "lxpolkit" spawnOnce "numlockx" diff --git a/.local/bin/calcurse-today b/.local/bin/calcurse-today new file mode 100755 index 0000000..4a4cc81 --- /dev/null +++ b/.local/bin/calcurse-today @@ -0,0 +1,9 @@ +#!/bin/bash +# Notify today's whole-day calcurse events (the daemon only alerts timed appointments). +set -euo pipefail + +events=$(calcurse -Q --filter-type event,recur-event --days 1 \ + --format-event '%m\n' --format-recur-event '%m\n' | tail -n +2) + +[[ -n $events ]] || exit 0 +notify-send -a calcurse -i x-office-calendar "Today" "$events"