#Help making a custom widget

1 messages · Page 1 of 1 (latest)

sterile gyro
#

Hi, I've been trying to make a custom widget. Essentially, this looks for windows with a specific title and parses a number from it.

discord.rs:
https://gist.github.com/SuppliedOrange/9882cd1f82a747119b14652b58b5c564

I've made the following changes:

Cargo.toml:
> windows = { workspace = true, features = ["Win32_UI_WindowsAndMessaging", "Win32_Foundation"] }

Using storage.rs as an example, I made similar changes in config.rs, widget.rs, main.rs.

In widget.rs, I cloned the object like so.

WidgetConfig::Discord(config) => Box::new(Discord::from(config.clone())),

This compiles fine but every schema.bar.json I point to returns this error:

C:\Users\Doog\Desktop\komorebi\target\release> komorebi-bar -c "C:/Users/Doog/Desktop/komorebi/schema.bar.json
2025-01-23T18:46:10.548330Z  INFO komorebi_bar: found configuration file: C:/Users/Doog/Desktop/komorebi/schema.bar.json
   0: missing field `monitor` at line 3038 column 5

Location:
   komorebi-bar\src\config.rs:105

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1: BaseThreadInitThunk<unknown>
      at <unknown source file>:<unknown line>
   2: RtlUserThreadStart<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.

This also happens when I point to a new but unchanged schema.bar.json:
https://gist.githubusercontent.com/SuppliedOrange/18ca97e42a923a6b8bf388f59359c090/raw/0bd556866a7fca6df160c3d9e136b6e13bf38e62/schema.bar.json

And I get the same error with the discord widget in it.
https://gist.githubusercontent.com/SuppliedOrange/18ca97e42a923a6b8bf388f59359c090/raw/a1c67f861a091f2c361172898a448e4ae014f742/schema.bar.json

Would help if I could understand what's happening here.

orchid ether
#

You don't pass the schema to the komorebi-bar with -c. That is supposed to be used to pass a configuration file! The schema is just a file that lets editors know how a configuration file should look and what options can you add to it. You need to pass your bar config komorebi.bar.json or use the example config and then add any configuration needed for your widget to that file.

sterile gyro