update readme

This commit is contained in:
Emil Lerch 2026-03-02 14:14:28 -08:00
parent e45b1fc1b6
commit 9b6980bf71
Signed by: lobo
GPG key ID: A7B62D657EF764F8

View file

@ -1,44 +1,37 @@
# Cosmic Weather Applet # Cosmic Weather Applet
Weather applet for COSMIC A weather applet for the [COSMIC](https://github.com/pop-os/cosmic-epoch) desktop environment that displays current conditions in the panel and a full forecast in a popup. Weather data is provided by [wttr.in](https://wttr.in) using IP-based geolocation.
## Installation ## Building
A [justfile](./justfile) is included by default for the [casey/just][just] command runner. Requires a Rust toolchain. Install via [rustup](https://rustup.rs/) if needed.
- `just` builds the application with the default `just build-release` recipe
- `just run` builds and runs the application
- `just install` installs the project into the system
- `just vendor` creates a vendored tarball
- `just build-vendored` compiles with vendored dependencies from that tarball
- `just check` runs clippy on the project to check for linter warnings
- `just check-json` can be used by IDEs that support LSP
## Translators
[Fluent][fluent] is used for localization of the software. Fluent's translation files are found in the [i18n directory](./i18n). New translations may copy the [English (en) localization](./i18n/en) of the project, rename `en` to the desired [ISO 639-1 language code][iso-codes], and then translations can be provided for each [message identifier][fluent-guide]. If no translation is necessary, the message may be omitted.
## Packaging
If packaging for a Linux distribution, vendor dependencies locally with the `vendor` rule, and build with the vendored sources using the `build-vendored` rule. When installing files, use the `rootdir` and `prefix` variables to change installation paths.
```sh ```sh
just vendor cargo build --release
just build-vendored
just rootdir=debian/cosmic-weather-applet prefix=/usr install
``` ```
It is recommended to build a source tarball with the vendored dependencies, which can typically be done by running `just vendor` on the host system before it enters the build environment. ## Testing
## Developers For development, `cargo run` launches the applet in a standalone window in the center of the display. It behaves the same as when embedded in the panel.
Developers should install [rustup][rustup] and configure their editor to use [rust-analyzer][rust-analyzer]. To improve compilation times, disable LTO in the release profile, install the [mold][mold] linker, and configure [sccache][sccache] for use with Rust. The [mold][mold] linker will only improve link times if LTO is disabled. ```sh
cargo run
```
[fluent]: https://projectfluent.org/ ## Deploying
[fluent-guide]: https://projectfluent.org/fluent/guide/hello.html
[iso-codes]: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes To deploy to your local user session, build a release binary, replace the running instance, and restart the panel so it picks up the new binary:
[just]: https://github.com/casey/just
[rustup]: https://rustup.rs/ ```sh
[rust-analyzer]: https://rust-analyzer.github.io/ cargo build --release
[mold]: https://github.com/rui314/mold cp target/release/cosmic-weather-applet ~/.local/bin/
[sccache]: https://github.com/mozilla/sccache # Restart the applet and panel
killall cosmic-weather-applet
killall cosmic-panel
```
The panel will relaunch automatically and load the updated applet.
## Localization
[Fluent](https://projectfluent.org/) is used for localization. Translation files are in the [i18n directory](./i18n). To add a new language, copy the [English (en) localization](./i18n/en), rename the directory to the target [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes), and translate the message values.