Document the -s flag, SYSTAB_TYPE=service marker, service vs timer
branching in _write_unit_files, get_managed_service_jobs,
is_job_service, daemon-reload ordering, ActiveState/SubState status
display, the 's' flag in parse_flags/build_flags_string, and the
updated test count (81).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
44 tests covering job creation, status, logs, pause/resume,
notifications, time format parsing, error cases, and cleanup.
Tests run against real systemd user timers with automatic cleanup.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Extract build_job_list helper (shared by show_status/list_logs)
- clean_jobs now calls remove_job instead of inline stop/disable/rm
- Extract status preamble in write_notify_lines (icon_pre/status_pre)
- Replace fragile list-timers tail/awk with systemctl show properties
- Combine consecutive sed -i calls into single invocations
- Simplify is_manage_mode check to use existing manage_count
- Make -o accept optional line count arg (-o 20 or just -o for default 10)
- Fix %%s escaping in unit files and document in CLAUDE.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
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>
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>
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>