PRs are always a huge help 💛. Check out issues marked as good first issue or help wanted to get started.
First fork, then clone the repo:
git clone git@github.com:your-username/zebar.gitIf not already installed, install Rust and Node.js v20, then run:
# Install pnpm (package manager).
npm i -g pnpm
# Install dependencies.
pnpm i
# Start in development mode. (config: ~/.glzr/zebar/)
pnpm devAfter making your changes, push to your fork and submit a pull request. Please try to address only a single feature or fix in the PR so that it's easy to review.
rustup is the de-facto way to set up the Rust toolchain.
Install Node.js via the official download or a version manager like NVM (download - works on Unix and WSL/Git Bash on Windows).
Zebar is split into 2 packages:
desktop
A Tauri desktop application which acts as the backend for spawning and communicating with windows.
client-api
JS package for communicating with the Tauri backend. Published to npm as zebar.
-
Add the client-side logic for the provider. Most providers aren't client-side heavy, and simply subscribe to some outputs sent from the Tauri backend (eg.
create-ip-provider.ts).- Add a new provider under
client-api/src/providers/<YOUR_PROVIDER>. - Modify
create-provider.tsto add the new provider to theProviderConfigMapandProviderMaptypes, and to create the provider in the switch statement withincreateProvider. - Export the provider's types from
client-api/src/providers/index.ts.
- Add a new provider under
-
Add the backend logic for the provider.
- Add the logic for the provider under
desktop/src/providers/<YOUR_PROVIDER>. - Add the provider's config to the
ProviderConfigenum. - Add the provider's outputs to the
ProviderOutputenum. - Add the provider to the switch statement in
create_provider(...). - Add the provider's exports to
desktop/src/providers/mod.rs
- Add the logic for the provider under
Just like in production, when running pnpm dev, Zebar will use the widgets found within your config directory (i.e. ~/.glzr/zebar/*). However, when developing locally, you may want to use a local zebar NPM package. To do so, run:
cd path/to/your/widget
# If using pnpm:
pnpm add --link ../../path/to/zebar/packages/client-api
# If using npm:
npm install ../../path/to/zebar/packages/client-apiThis will create a symlink to the local zebar NPM package and results in a package.json similar to this:
{
"dependencies": {
"zebar": "link:../../repos/zebar/packages/client-api"
}
}On MacOS, the settings UI may use cached versions of dependencies. To resolve this:
- Delete the
packages/settings-ui/.vitedirectory - Run
pnpm devagain