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

Services Overview

Services are the backend layer of ashell. They manage communication with system APIs and produce events that modules consume. Services have no UI.

Available Services

ServiceLocationBackendProtocol
Compositorservices/compositor/Hyprland / NiriIPC socket
Audioservices/audio.rsPulseAudiolibpulse C library
Brightnessservices/brightness.rssysfs + logindFile I/O + D-Bus
Bluetoothservices/bluetooth/BlueZD-Bus
Networkservices/network/NetworkManager / IWDD-Bus
MPRISservices/mpris/Media playersD-Bus
Trayservices/tray/StatusNotifierItemD-Bus
UPowerservices/upower/UPower daemonD-Bus
Privacyservices/privacy.rsPipeWire portalsD-Bus
Idle Inhibitorservices/idle_inhibitor.rssystemd-logindD-Bus
Logindservices/logind.rssystemd-logindD-Bus
Throttleservices/throttle.rs(utility)Stream adapter

Services vs. Modules

AspectModuleService
Has UIYes (view())No
Interacts with systemNo (consumes services)Yes
Has Message typeYesHas UpdateEvent + ServiceEvent
Defined byConventionReadOnlyService / Service trait
Runs onMain thread (iced event loop)Async (tokio) or dedicated thread

Service Communication Pattern

Service (async/background)
    │
    ▼ ServiceEvent<S>
Module subscription
    │
    ▼ Module::Message
App::update()
    │
    ▼ Service::command() (for bidirectional services)
Service (executes command, returns result)

Threading Model

  • Main thread: iced event loop + rendering
  • Tokio runtime: Most services (D-Bus watchers, timers, IPC)
  • Dedicated OS thread: PulseAudio mainloop (libpulse requires its own event loop)
  • Communication: tokio::sync::mpsc channels between threads, iced channel() for subscriptions