Introduction

Mobile data usage is something I use every day, but it’s surprisingly hard to track on Linux phones. In this post, I’ll walk through the design and implementation of a WWAN data monitor for Phosh, built as a D-Bus service using Rust and zbus.

Goals

  • Monitor data usage per SIM / interface
  • Track daily, monthly and total usage
  • Enforce data limits and show notifications
  • Integrate with Phosh Mobile Settings

Architecture

+----------------+     +---------------+     +-----------------+     +--------------+
| NetworkManager | --> |  WWAN Device  | --> | Monitor Service | --> | D-Bus / Phosh|
+----------------+     +---------------+     +-----------------+     +--------------+