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
icedGit (MalpenZibo fork)GUI framework with Wayland layer shell support

The iced dependency uses many features:

  • tokio — Async runtime integration
  • multi-window — Multiple layer surfaces (bar + menu per monitor)
  • advanced — Custom widget support
  • wgpu — GPU-accelerated rendering
  • winit — Window system integration
  • wayland — Wayland protocol support
  • image, svg, canvas — Graphics capabilities

Async Runtime

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

Compositor Integration

CrateVersionPurpose
hyprland0.4.0-beta.2Hyprland IPC client
niri-ipc25.11.0Niri IPC client

System Integration

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

Configuration

CrateVersionPurpose
toml0.9TOML config file parsing
serde1.0Serialization/deserialization
serde_json1JSON for tray menu data
serde_with3.12Advanced serde derivation
clap4.5CLI argument parsing
inotify0.11.0File 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.14Iterator utilities
anyhow1Error handling
log0.4Logging facade
flexi_logger0.31Logging implementation
signal-hook0.4.3Unix signal handling (SIGUSR1)
reqwest0.13HTTP client (weather data)
uuid1UUID generation
url2.5.7URL parsing
freedesktop-icons0.4XDG icon lookup
linicon-theme1.2.0Icon theme resolution
shellexpand3Tilde/env var expansion in paths
parking_lot0.12.5Synchronization primitives
pin-project-lite0.2.16Pin projection (for throttle stream)
libc0.2.182System call interfaces

Build Dependencies

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

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"]
depends = ["libxkbcommon", "dbus"]

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

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