Skip to content

Latest commit

 

History

History
74 lines (59 loc) · 1.85 KB

File metadata and controls

74 lines (59 loc) · 1.85 KB

xclock plugins

Official plugins for xclock.

Plugins are standalone executables. The kernel sends a JSON request on stdin and reads a JSON response from stdout, so plugins can be written in any language. The Rust crates in this repository use the shared xclock-plugin-api crate.

Plugins

Plugin Description Example args
timezone World clock from UTC offsets { "zones": [{ "label": "Tokyo", "utc_offset": 9 }] }
time-progress Progress of the day, week and year none
system-stats CPU, memory, load average and uptime none
user-info User, host and shell none
git-status Git branch and working tree status { "path": "~/project" }
weather Current weather from wttr.in { "city": "Madrid" }

Install

xclock plugin install timezone

The kernel clones this repository, builds the requested plugin and installs the binary into the xclock plugins directory.

Use

Reference a plugin from a dashboard widget:

{
  "layout": {
    "direction": "horizontal",
    "ratio": [50, 50],
    "children": [
      { "widget": "clock" },
      {
        "widget": "plugin",
        "options": {
          "name": "timezone",
          "refresh_secs": 60,
          "args": {
            "zones": [
              { "label": "Madrid", "utc_offset": 2 },
              { "label": "Tokyo", "utc_offset": 9 }
            ]
          }
        }
      }
    ]
  }
}

Run a plugin once from the command line:

xclock plugin run timezone

Development

cargo build --release
cargo test

The crates depend on the xclock-plugin-api crate from its repository. The full authoring guide lives in docs/README.md.