Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 1.02 KB

File metadata and controls

45 lines (33 loc) · 1.02 KB

xclock extensions

Extensions are small executables that run on xclock events or on demand. They are installed into the xclock data directory and referenced by name.

Layout

scripts/notify-finished.sh   Notify when a timer finishes
scripts/log-event.sh         Append events to a log file
scripts/say.sh               Speak the event (macOS/Linux)
scripts/notify.ps1           Windows notification example

Install

xclock extension install scripts/notify-finished.sh

The name is taken from the file stem, so the extension above is installed as notify-finished.

Use from hooks

{
  "hooks": {
    "on_timer_finish": ["notify-finished time is up"],
    "on_task_done": ["log-event task done"],
    "on_habit_check": ["log-event habit checked"]
  }
}

Hooks run through the system shell (sh -c on Unix, cmd /C on Windows).

Run manually

xclock extension list
xclock extension run notify-finished "coffee break"

Extensions receive their arguments as $1, $2, and so on.