chore(readme): add cosmic-app-template

This commit is contained in:
Michael Aaron Murphy 2024-07-29 13:21:58 +02:00
parent 4f77edd249
commit 2170a65c89
No known key found for this signature in database
GPG key ID: B2732D4240C9212C

View file

@ -1,26 +1,32 @@
# LIBCOSMIC # LIBCOSMIC
A platform toolkit based on iced which provides the building blocks for developing the A platform toolkit based on iced for creating applets and applications for the COSMIC™ desktop.
future COSMIC desktop environment. Applications and applets alike are equally supported
targets of Libcosmic. Applets integrate directly with COSMIC's interface as shell
components, which was made possible by the Layer Shell protocol of Wayland.
## Building ## Documentation
Libcosmic is written entirely in Rust, with minimal dependence on system libraries. On - [API Documentation](https://pop-os.github.io/libcosmic/cosmic/): Automatically generated from this repository via `cargo doc`
Pop!_OS, the following dependencies are all that's necessary compile the cosmic library: - [libcosmic Book](https://pop-os.github.io/libcosmic-book/): A reference for learning libcosmic
## Templates
- https://github.com/pop-os/cosmic-app-template: Application project template
## Dependencies
While libcosmic is written entirely in Rust, some of its dependencies may require shared system library headers to be installed. On Pop!_OS, the following dependencies are all that's necessary compile a typical COSMIC project:
```sh ```sh
sudo apt install cargo cmake just libexpat1-dev libfontconfig-dev libfreetype-dev pkg-config sudo apt install cargo cmake just libexpat1-dev libfontconfig-dev libfreetype-dev libxkbcommon-dev pkgconf
``` ```
## Examples
Some examples are included in the [examples](./examples) directory to to kickstart your Some examples are included in the [examples](./examples) directory to to kickstart your
COSMIC adventure. To run them, you need to clone the repository with the following commands: COSMIC adventure. To run them, you need to clone the repository with the following commands:
```sh ```sh
git clone https://github.com/pop-os/libcosmic git clone https://github.com/pop-os/libcosmic
cd libcosmic cd libcosmic
git submodule update --init --recursive
``` ```
If you have already cloned the repository, run these to sync with the latest updates: If you have already cloned the repository, run these to sync with the latest updates:
@ -29,31 +35,11 @@ If you have already cloned the repository, run these to sync with the latest upd
git fetch origin git fetch origin
git checkout master git checkout master
git reset --hard origin/master git reset --hard origin/master
git submodule update --init --recursive
``` ```
The examples may then be run by their cargo project names, such as `just run cosmic-design-demo`. The examples may then be run by their cargo project names, such as `just run application`.
To create a new COSMIC project, use `cargo new {{name_of_project}}` to create a new ## Cargo Features
project workspace, edit the `Cargo.toml` contained within, and add this to begin.
```toml
[workspace.dependencies.libcosmic]
git = "https://github.com/pop-os/libcosmic"
default-features = false
features = ["wayland", "tokio"]
```
Alternatively, to create a new package after running `cargo new {{name_of_project}}`,
edit the `Cargo.toml` within, and edit the dependencies section to look like this.
```toml
[dependencies]
libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false,
features = ["wayland", "tokio"] }
```
### Cargo Features
Available cargo features to choose from: Available cargo features to choose from:
@ -83,10 +69,6 @@ Available cargo features to choose from:
- [COSMIC Text Editor](https://github.com/pop-os/cosmic-text-editor) - [COSMIC Text Editor](https://github.com/pop-os/cosmic-text-editor)
- [COSMIC Settings](https://github.com/pop-os/cosmic-settings) - [COSMIC Settings](https://github.com/pop-os/cosmic-settings)
## Documentation
Documentation can be found [here](https://pop-os.github.io/libcosmic/cosmic/).
## Licence ## Licence
Licensed under the [Mozilla Public License 2.0](https://choosealicense.com/licenses/mpl-2.0). Licensed under the [Mozilla Public License 2.0](https://choosealicense.com/licenses/mpl-2.0).