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

ServiceLocationBackendProtocolRequired Package
Compositorservices/compositor/Hyprland / NiriIPC socketHyprland or Niri
Audioservices/audio.rsPulseAudiolibpulse C libraryPulseAudio or PipeWire-Pulse
Brightnessservices/brightness.rssysfs + logindFile I/O + D-Bussystemd-logind
Bluetoothservices/bluetooth/BlueZD-Busbluez
Networkservices/network/NetworkManager / IWDD-Busnetworkmanager or iwd
MPRISservices/mpris/Media playersD-BusMPRIS-compatible player
Trayservices/tray/StatusNotifierItemD-Bus
UPowerservices/upower/UPower daemonD-Busupower
Privacyservices/privacy.rsPipeWirePipeWire portalspipewire
Idle Inhibitorservices/idle_inhibitor.rssystemd-logindD-Bussystemd-logind
Logindservices/logind.rssystemd-logindD-Bussystemd-logind
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