Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
filters: |
code:
- 'src/**'
- 'crates/**'
- 'assets/**'
- 'build.rs'
- 'Cargo.toml'
Expand All @@ -52,7 +53,11 @@ jobs:

- name: Clippy
if: steps.filter.outputs.code == 'true'
run: cargo clippy --all-features -- -D warnings
run: cargo clippy --workspace --all-features -- -D warnings

- name: Test ashell-services
if: steps.filter.outputs.code == 'true'
run: cargo test -p ashell-services --all-features

- name: Build
if: steps.filter.outputs.code == 'true'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nix-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
filters: |
code:
- 'src/**'
- 'crates/**'
- 'assets/**'
- 'build.rs'
- 'Cargo.toml'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ jobs:
# Install cargo-edit for `cargo set-version`
cargo install cargo-edit -f --no-default-features --features "set-version"

# Update the root package version
cargo set-version "${VERSION}"
# Update every workspace member, so the crates stay in step with ashell
cargo set-version --workspace "${VERSION}"

- name: Git add updated cargo toml
run: |
Expand Down
11 changes: 7 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Quick reference

```bash
make check # format check + cargo check + clippy -D warnings (run before pushing)
make check # format check + cargo check + clippy -D warnings on the whole workspace (run before pushing)
make build # cargo build --release
make fmt # cargo fmt
make start # run ./target/release/ashell
Expand Down Expand Up @@ -40,17 +40,20 @@ src/
├── components/ # shared UI components, icons
├── modules/ # UI modules (clock, workspaces, settings, tray, etc.)
│ └── settings/ # settings sub-panels (audio, network, bluetooth, power, brightness)
├── services/ # backend services (D-Bus, IPC, system integration)
├── services/ # iced glue (ReadOnlyService/Service) + services not yet migrated to ashell-services
│ ├── compositor/ # Hyprland/Niri/generic Wayland abstraction
│ ├── network/ # NetworkManager + IWD backends
│ ├── bluetooth/
│ ├── mpris/ # media player control
│ ├── tray/
│ └── upower/ # battery/power
├── widgets/ # custom iced widgets (centerbox, position_button, menu_wrapper)
└── utils/
crates/
└── ashell-services/ # UI-agnostic services (no iced dependency), e.g. bluetooth
```

The repo is a Cargo workspace: the root package is the `ashell` binary, `crates/ashell-services` is a library member.

## Key system dependencies

libxkbcommon, libwayland, libpipewire-0.3, libpulse, dbus, udev, pkg-config, clang/llvm
Expand Down Expand Up @@ -94,7 +97,7 @@ Scope examples: `fix(brightness)`, `feat(system_info)`, `fix(network)`
## Architecture patterns

- **Elm architecture:** `App` struct holds all state. `Message` enum drives updates. `update()` returns `Task<Message>` for async work.
- **Services** are backend abstractions (D-Bus, IPC). Two traits: `ReadOnlyService` and `Service` (mutable).
- **Services** are backend abstractions (D-Bus, IPC). Two traits: `ReadOnlyService` and `Service` (mutable). Services moved to `ashell-services` expose a plain API with no trait (a cloneable handle with `execute(command)` and an updates `Stream` that starts with the current state); a module in `src/services/` wraps each one into the iced traits.
- **Modules** are UI components (workspaces, clock, settings). Each implements `view()` returning iced `Element`.
- **Compositor abstraction:** the `CompositorChoice` enum routes to per-backend modules (Hyprland, Niri, generic Wayland), each exposing `is_available`/`run_listener`/`execute_command`, auto-detected at runtime.
- **Config hot-reload:** inotify file watcher triggers `ConfigChanged` message on config file changes.
29 changes: 21 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 31 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
[package]
name = "ashell"
description = "A ready to go status bar for Wayland compositors"
homepage = "https://malpenzibo.github.io/ashell/"
[workspace]
members = ["crates/ashell-services"]

[workspace.package]
repository = "https://github.com/MalpenZibo/ashell"
authors = ["Simone Camito (Zibo)"]
license = "GPL-3.0-or-later"
version = "0.11.0"
edition = "2024"
rust-version = "1.89"

[workspace.dependencies]
anyhow = "1"
inotify = { version = "0.11.1", default-features = false, features = [
"stream",
] }
log = { version = "0.4", features = [] }
tokio = { version = "1", default-features = false }
zbus = { version = "5", default-features = false, features = ["tokio"] }

[package]
name = "ashell"
description = "A ready to go status bar for Wayland compositors"
homepage = "https://malpenzibo.github.io/ashell/"
repository.workspace = true
authors.workspace = true
license.workspace = true
version = "0.11.0"
edition.workspace = true
rust-version.workspace = true

[profile.release]
lto = "thin"
strip = true
Expand All @@ -29,7 +48,8 @@ depends = ["libwayland-client0", "libpipewire-0.3-0t64", "libpulse0"]
depends = ["libwayland-client", "pipewire-libs", "pulseaudio-libs"]

[dependencies]
iced = { package = "iced_layershell", git = "https://github.com/MalpenZibo/iced_layershell", tag = "v0.6.0", features = [
ashell-services = { path = "crates/ashell-services", features = ["bluetooth"] }
iced = { package = "iced_layershell", git = "https://github.com/MalpenZibo/iced_layershell", tag = "v0.6.1", features = [
"tokio",
"advanced",
"wgpu",
Expand All @@ -47,16 +67,16 @@ chrono = { version = "0.4", default-features = false, features = [
hyprland = { git = "https://github.com/hyprland-community/hyprland-rs", branch = "master" }
serde = { version = "1.0", default-features = false, features = [] }
sysinfo = { version = "0.39", features = ["linux-netdevs"] }
tokio = { version = "1", default-features = false, features = ["net"] }
zbus = { version = "5", default-features = false, features = ["tokio"] }
tokio = { workspace = true, features = ["net"] }
zbus.workspace = true
libpulse-binding = { version = "2.28", features = ["pa_v15"] }
log = { version = "0.4", features = [] }
log.workspace = true
flexi_logger = "0.31"
pipewire = "0.10"
itertools = "0.15"
unicode-segmentation = "1.13.2"
hex_color = { version = "3", features = ["serde"] }
anyhow = "1"
anyhow.workspace = true
udev = { version = "0.9", features = ["send", "sync"] }
toml = "1"
serde_ignored = "0.1"
Expand All @@ -76,9 +96,7 @@ clap = { version = "4.5", default-features = false, features = [
"help",
] }
shellexpand = { version = "3", features = ["path"] }
inotify = { version = "0.11.1", default-features = false, features = [
"stream",
] }
inotify.workspace = true
pin-project-lite = "0.2.16"
niri-ipc = "26.4"
reqwest = { version = "0.13", default-features = false, features = [
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ fmt:
cargo fmt

check: fmt
cargo check
cargo clippy -- -D warnings
cargo check --workspace
cargo clippy --workspace -- -D warnings
cargo test -p ashell-services --all-features
22 changes: 22 additions & 0 deletions crates/ashell-services/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "ashell-services"
description = "UI-agnostic backend services for ashell"
version = "0.11.0"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true
publish = false

[features]
bluetooth = ["rfkill", "dep:zbus", "tokio/time"]
rfkill = ["dep:anyhow", "dep:inotify", "dep:log", "dep:tokio", "tokio/process"]

[dependencies]
futures = "0.3"
anyhow = { workspace = true, optional = true }
inotify = { workspace = true, optional = true }
log = { workspace = true, optional = true }
tokio = { workspace = true, optional = true }
zbus = { workspace = true, optional = true }
Loading
Loading