32d472a606058338657fa8a5711af71adc1438eb
- Add `@std/jsonc` as a dependency in `deno.jsonc` and `deno.lock` - Update i18n loader to support `.jsonc` files with comments - Rename locale files from `.json` to `.jsonc` and add inline comments - Set VSCode to use Deno JSONC formatter for `jsonc` files This change enables the i18n module to load translation files written in JSONC format, allowing for inline comments and improved readability. The `@std/jsonc` library is added as a dependency and used to parse both JSON and JSONC files. The loader prioritizes `.jsonc` files when both `.json` and `.jsonc` exist. VSCode settings are updated to use the Deno formatter for JSONC files. Locale files are renamed and enhanced with comments for clarity. Merged from feature/change-language-json-to-jsonc into main
systemd-timer
A simple CLI tool for quickly generating systemd .service and .timer units — as a replacement or modern supplement to classic cron jobs.
🚀 Features
- Generates
.serviceand.timerfiles via CLI - Supports
--usertimers (for~/.config/systemd/user/) - Optional logging (
StandardOutput/StandardError) - Supports:
--calendar: Timer schedule (systemdOnCalendar)--exec: Command to execute (ExecStart)--description: Description for the unit--after:After=dependencies in the service unit--environment: ArbitraryEnvironment=KEY=VALUEentries--output: Target directory for the generated unit files--run-as: SetsUser=in the service unit (only for system-level timers)--home: SetsEnvironment=HOME=…--cwd: Working directory for the process (WorkingDirectory)--dry-run: Outputs unit content without writing to disk
- Tested and fully typed with Deno + Cliffy
🛠️ Installation
You can install systemd-timer directly via shell script:
curl -fsSL https://git.0xmax42.io/maxp/systemd-timer/raw/branch/main/scripts/install.sh | sh
The script automatically detects your platform (Linux amd64 or arm64) and installs the appropriate binary to /usr/local/bin, if permitted (possibly using sudo).
Note:
- A working internet connection is required for installation.
- The integrity of the binary is verified using a SHA256 checksum.
- You can manually inspect the script before execution:
curl -fsSL https://git.0xmax42.io/maxp/systemd-timer/raw/branch/main/scripts/install.sh -o install.sh
less install.sh
Additional options and manual installation methods are available under scripts/install.sh.
📦 Example
./systemd-timer create \
--exec "/usr/local/bin/backup.sh" \
--calendar "Mon..Fri 02:00" \
--description "Backup Job" \
--user \
--logfile "/var/log/backup.log"
This creates:
~/.config/systemd/user/backup.service~/.config/systemd/user/backup.timer
Activate afterwards:
systemctl --user daemon-reload
systemctl --user enable --now backup.timer
🧪 Running Tests
deno task test
🧰 Development
deno task start create --exec "/bin/true" --calendar "daily" --dry-run
🔒 Permissions / Flags
The tool requires the following permissions when running or compiling:
--allow-env(for$HOME)--allow-write(to write.service/.timerfiles)
During development, usually -A (allow all) is used.
📝 License
Releases
9
Release v0.5.1
Latest
Languages
TypeScript
86%
Shell
14%