Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Cargo and Dependencies

ashell’s dependencies are managed in Cargo.toml. This chapter covers the key dependencies and why they’re used.

Core Dependencies

UI Framework

CrateVersionPurpose
iced (iced_layershell)Git (v0.6.0)GUI framework with Wayland layer shell support via iced_layershell

The dependency is aliased as iced in Cargo.toml (package = "iced_layershell"). It uses these features:

  • tokio — Async runtime integration
  • advanced — Custom widget support
  • wgpu — GPU-accelerated rendering
  • tiny-skia — Software rendering fallback
  • image, svg, canvas — Graphics capabilities

Async Runtime

CrateVersionPurpose
tokio1Async runtime for services
tokio-stream0.1Stream utilities

Compositor Integration

CrateVersionPurpose
hyprlandGit (master)Hyprland IPC client
niri-ipc26.4Niri IPC client

System Integration

CrateVersionPurpose
zbus5D-Bus client (BlueZ, NM, UPower, etc.)
libpulse-binding2.28PulseAudio client library
pipewire0.10PipeWire integration
wayland-client0.31Wayland protocol client
wayland-protocols0.32Wayland protocol definitions
sysinfo0.39CPU, RAM, disk, network statistics
udev0.9Device monitoring

Configuration

CrateVersionPurpose
toml1TOML config file parsing
serde1.0Serialization/deserialization
serde_json1JSON parsing (custom modules, compositor IPC, weather)
serde_with3.12Advanced serde derivation
clap4.5CLI argument parsing
inotify0.11.1File change watching

Utilities

CrateVersionPurpose
chrono0.4Date/time handling
chrono-tz0.10.4Timezone support
regex1.12.2Regular expressions (config parsing)
hex_color3Hex color parsing in config
itertools0.15Iterator utilities
anyhow1Error handling
log0.4Logging facade
flexi_logger0.31Logging implementation
signal-hook0.4.3Unix signal handling (SIGUSR1)
reqwest0.13HTTP client (weather data, media artwork)
url2.5.7URL parsing
freedesktop-icons0.4XDG icon lookup
linicon-theme1.2.0Icon theme resolution
shellexpand3Tilde/env var expansion in paths
pin-project-lite0.2.16Pin projection (for throttle stream)
libc0.2.182System call interfaces

Build Dependencies

CrateVersionPurpose
allsorts0.17Font parsing and subsetting in build.rs

Git Sources

Three dependencies come from git instead of crates.io:

  • iced_layershell (aliased as iced) — pinned to tag v0.6.0
  • hyprland — tracks the master branch
  • softbuffer — replaced via [patch.crates-io] with a fork (branch wayland-argb) that uses wl_shm Argb8888, so the tiny-skia fallback renderer honors alpha on Wayland (upstream hardcodes Xrgb8888, which the compositor treats as fully opaque). The fork is based on v0.4.8 to match the iced_tiny_skia release iced depends on — rebasing it past 0.4.x will break the patch.

Cargo.lock pins each source to an exact commit, so clones build reproducibly; only an explicit cargo update -p <crate> moves a branch-tracking dependency.

Release Profile

[profile.release]
lto = "thin"       # Link-Time Optimization (balances speed vs compile time)
strip = true       # Remove debug symbols from binary
opt-level = 3      # Maximum optimization
panic = "abort"    # No stack unwinding (smaller binary)

Runtime Package Dependencies

For binary distribution, runtime dependencies are declared in Cargo.toml metadata:

[package.metadata.nfpm]
provides = ["ashell"]

[package.metadata.nfpm.overrides.deb]
depends = ["libxkbcommon0", "libwayland-client0", "libpipewire-0.3-0t64", "libpulse0", "libudev1", "dbus"]

[package.metadata.nfpm.overrides.rpm]
depends = ["libxkbcommon", "libwayland-client", "pipewire-libs", "pulseaudio-libs", "systemd-libs", "dbus"]

Dependencies go under overrides because package names differ per distro (libxkbcommon0 on Debian/Ubuntu, libxkbcommon on Fedora). cargo-nfpm ignores depends in the plain [package.metadata.nfpm.deb] / .rpm tables. When adding a crate that links a new system library, add it to both lists. Check the result with readelf -d target/release/ashell | grep NEEDED.