Commit graph

6 commits

Author SHA1 Message Date
67528374cd Add -o flag to include job output in notifications
Fetches the last N lines of journal output (default 10) via
journalctl and includes them in desktop/email notification bodies.
Supports CLI (-o 5) and edit mode (o or o=5 flag syntax).

Also fixes systemd %s specifier expansion in email printf format
strings (must use %%s so systemd passes %s through to the shell).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 16:35:52 -07:00
98b180a912 Refactor: deduplicate and simplify systab
Merge get_managed_services/get_managed_timers into get_managed_units
with a type parameter, drop unnecessary seen array. Extract shared
_write_unit_files core from create_job and create_job_from_edit. Add
get_job_command helper to replace triple-sed command extraction (3
call sites). Deduplicate list-timers call in show_status. Replace
rg/grep pipe in list_logs with journalctl --grep. Remove redundant
-h pre-scan loop in main. Net -97 lines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 15:45:28 -07:00
ef442d464c Add status-aware notifications, edit mode flags, job ID filtering
Notifications now use ExecStopPost (fires on success and failure) with
status-aware icons/messages instead of ExecStartPost (success only).
Desktop uses dialog-information/dialog-error, email uses sendmail.
Flags (i, e=addr) are persisted as # SYSTAB_FLAGS= comments in service
files and exposed in edit mode via ID:flags syntax. Edit mode validates
schedules before applying (re-edit loop like crontab -e). -S and -L
accept an optional job ID to filter to a single job. Extract trim()
helper to replace inline whitespace-stripping idiom.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 14:43:06 -07:00
37efa43d0a first functional commit 2026-02-14 11:34:00 -07:00
5e961d70f4 Use short ID as unit filename instead of timestamp
Unit files are now named systab_<6-char-hex> (e.g., systab_a1b2c3),
so the ID is derived from the filename — no more SYSTAB_ID comments
in unit files, no id-to-jobname mappings in edit mode. Removes
generate_job_name, get_job_id, get_job_by_id, ensure_job_id.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 00:22:51 -07:00
941772dd5c Update CLAUDE.md to reflect edit mode and short IDs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 23:14:49 -07:00