Skip to content

About

Native, privacy-first digital wellbeing & battery telemetry for Linux (GNOME / Zorin OS) — ~32 KB C11 session collector + GTK 4 / libadwaita dashboard

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

Lumen Logo

Lumen ⏱️⚡

Native, Privacy-First Screen Time Tracker & Digital Wellbeing for Linux

Release Distros Session Collector RAM Usage UI Privacy License: MIT

The ultra-lightweight Apple Screen Time & Android Digital Wellbeing alternative for the Linux Desktop.
A tiny ~32 KB C11 daemon records screen time, idle, lock, suspend, and battery telemetry in the background.
The GTK 4 + libadwaita dashboard runs only when you open it—consuming zero UI memory the rest of the day.

Quick Install • Why Lumen? • Comparison • Features • Supported Distributions • Architecture • CLI Usage • FAQ & Google Search Help


Looking for a native Linux screen time tracker, GNOME digital wellbeing app, or a lightweight ActivityWatch alternative?
Lumen gives Linux users (Ubuntu, Fedora, Arch Linux, Zorin OS, Debian, Pop!_OS) detailed daily app usage breakdowns, 7-day activity rings, interactive monthly heatmaps, and live battery discharge telemetry—built with 100% offline privacy and zero keystroke or window-title logging.


⚡ Quick Install

Copy and paste this one-liner to install dependencies, compile the native C11 collector, and register the background service:

# Clone & install Lumen in 30 seconds
git clone https://github.com/hurairamuzammal/linux-lumen.git
cd linux-lumen
chmod +x scripts/install.sh scripts/lumen
./scripts/install.sh

Launch Lumen anytime from your application launcher (Activities → Lumen) or via CLI:

lumen

✨ Why Lumen?

Most desktop time trackers either run a heavy Electron/Python process in the background 24/7 or log invasive metadata like window titles, URLs, and keystrokes.

Lumen is engineered differently:

  1. Tiny Native Footprint: The background recorder (lumen-collect) is a ~32 KB compiled C11 binary running at Nice=10 and IOSchedulingClass=idle with a strict 32 MB systemd memory cap (typically using ~3–5 MB RSS).
  2. Wayland & X11 Native: Uses standard D-Bus (org.gnome.Mutter.IdleMonitor, systemd-logind) and AT-SPI2 accessibility focus—providing flawless screen time tracking on modern Wayland sessions without clunky XWayland workarounds.
  3. Zero Boot Delay: Runs strictly as an unprivileged systemd --user service bound to graphical-session.target. It starts after your desktop session logs in and stops cleanly on logout—never delaying kernel boot or GDM/SDDM display managers.
  4. On-Demand UI: The GTK 4 / libadwaita + WebKitGTK 6 interface (lumen) does not stay resident in the system tray or background. When you close the window, the UI process exits completely.
  5. Strict Privacy by Design: Window titles, browser tabs, URLs, document file names, keystrokes, and screenshots are never read or stored. All telemetry lives locally in ~/.local/share/lumen with strict 0700 / 0600 owner-only permissions and zero network access.

📊 Lumen vs Alternatives

Feature / Metric Lumen ⏱️ ActivityWatch RescueTime Apple Screen Time
Background Memory (RAM) ~3–5 MB RSS (C11) ~150–250 MB (Python/Web) ~80–130 MB (Electron) System Native (macOS only)
Linux Native Wayland Support ✅ 100% Flawless (AT-SPI2) ⚠️ Partial (XWayland issues) ❌ Incompatible ❌ macOS only
100% Offline (No Cloud Account) ✅ Yes (Strict Local) ✅ Yes (Local) ❌ Requires Cloud Account ⚠️ Apple ID Sync
Logs Window Titles & URLs ❌ Never (Private) ⚠️ Logs Titles & URLs ⚠️ Logs Titles & URLs ❌ No URLs logged
Battery Discharge Telemetry ✅ Built-in Wattage & ETA ❌ None ❌ None ⚠️ Basic stats
GTK 4 / libadwaita Theming ✅ Auto-Syncs with Accent ❌ Browser UI ❌ Electron UI ❌ macOS Aqua UI
Idle & Lock Auto-Detection ✅ Sub-second Mutter D-Bus ⚠️ Poll-based ⚠️ Poll-based ✅ Native
License MIT (Open Source) MPL 2.0 (Open Source) Proprietary / Paid Proprietary

🚀 Features

View / Capability Description
Today Dashboard Live-updating active screen time, idle counter, current focused app indicator, 24-hour activity area chart, and ranked app usage list.
7-Day Activity & Rings Stacked weekly usage/idle/lock bar chart, interactive daily progress ring cards with hover KPIs, and an inline Day Inspector with full timeline drill-down.
Apps & Fuzzy Search Instant fuzzy-matched search (exact, substring, subsequence, and Levenshtein typo tolerance) with match highlighting, 7-day totals, daily averages, and peak RSS memory tracking per app.
Battery Telemetry & Health Live /sys/class/power_supply diagnostics: charge curve canvas, real-time wattage draw (W), voltage (V), capacity (Wh), battery health (%), cycle count, and time-to-full / time-to-empty ETA.
12-Month Heatmap Calendar Interactive monthly heatmap calendar with 4 intensity tiers, monthly screen-time KPIs, top apps of the month, and seamless inspection of both recent (detailed) and older (rolled-up) days.
Sunday Letter Weekly reflection sheet comparing your Monday–Sunday screen time against the previous week with delta percentages and top apps.
Zorin OS & GTK Accent Sync Automatically extracts @define-color accent and window tokens from your active GTK 4 / Zorin OS theme (ZorinBlue, ZorinYellow, ZorinGreen, Adwaita, etc.) and updates live when you switch themes or Light/Dark mode.
One-Click Pause Pause tracking at any time from the header menu (☰ → Pause tracking). Pausing disables and stops lumen-collect.service so even a reboot won't resume tracking until you explicitly click Resume.

🐧 Supported Distributions

Lumen runs cleanly on all modern Linux distributions running a standard systemd user session:

  • Ubuntu Desktop: 24.04 LTS (Noble Numbat), 23.10, 22.04 LTS (Jammy Jellyfish)
  • Zorin OS: Zorin OS 17 (Core, Pro, Lite), Zorin OS 18
  • Fedora Workstation: Fedora 41, 40, 39, 38
  • Arch Linux & Derivatives: Arch Linux, Manjaro, EndeavourOS, Garuda Linux
  • Debian GNU/Linux: Debian 12 (Bookworm), Debian 13 (Trixie), Debian Sid
  • Pop!_OS & Linux Mint: Pop!_OS 22.04 / COSMIC, Linux Mint 21 & 22, elementary OS 7+
  • Desktop Environments: GNOME 42 to 47+, Zorin Desktop, Cinnamon, XFCE, and modern Wayland compositors supporting AT-SPI2.

🏗️ Architecture & Storage Format

flowchart LR
    subgraph Session["GNOME / Zorin Desktop Session"]
        ATSPI["AT-SPI2 Focus"]
        MUTTER["Mutter IdleMonitor\n& ScreenSaver D-Bus"]
        LOGIN1["systemd-logind\nLockedHint & PrepareForSleep"]
        SYSFS["/sys/class/power_supply\n& /proc/<pid>/smaps_rollup"]
    end

    subgraph Daemon["lumen-collect (C11 Daemon)"]
        POLL["8s Poll & Slice Merger"]
        ROLL["8-Day → Monthly JSON Rollup"]
    end

    subgraph Storage["~/.local/share/lumen (0700)"]
        LMN["days/YYYY-MM-DD.lmn\n(Packed Binary)"]
        CUR["current.json\n(Live Snapshot)"]
        MON["months/YYYY-MM.json\n(12-Month Archive)"]
    end

    subgraph App["lumen (GTK 4 + libadwaita + WebKitGTK 6)"]
        STORE["ui/lumen_store.py"]
        WEB["ui/web/ (Canvas UI)"]
    end

    ATSPI & MUTTER & LOGIN1 & SYSFS --> POLL
    POLL --> LMN & CUR
    ROLL --> MON
    LMN & CUR & MON --> STORE --> WEB
Loading

The .lmn Packed Binary Format (LMN1)

Instead of running an embedded SQLite database that wakes the disk with WAL checkpoints, lumen-collect merges consecutive unchanged intervals in memory and writes a compact binary day file (~/.local/share/lumen/days/YYYY-MM-DD.lmn, capped at 3 MB):

  • Header (128 bytes): Magic "LMN1", format version (1), first_boot timestamp, last_flush timestamp, cumulative sleep_sec, record count, and reserved padding.
  • Record Type 1 (Interval): u8 type=1 | u32 start_ts | u16 duration_sec | u8 state (0=active, 1=idle, 2=lock, 3=sleep) | u32 rss_kb | u8 name_len | char name[name_len].
  • Record Type 2 (Battery Sample): u8 type=2 | u32 ts | u8 pct | u8 status | u16 power_mw.
  • Record Type 3 (Suspend Span): u8 type=3 | u32 sleep_start | u32 wake_end (computed via CLOCK_BOOTTIME - CLOCK_MONOTONIC).

Automatic Data Retention & Rollup

  • Last 8 Days (days/*.lmn): Full hourly timelines, per-slice app intervals, RAM peaks, and battery curves are kept for today plus the past 7 days.
  • Up to 12 Months (months/YYYY-MM.json): Days older than 8 days are automatically rolled up into compact monthly JSON summaries (retaining daily active/idle/lock/sleep totals and per-app totals) and the raw .lmn file is unlinked. Monthly archives older than 12 months are automatically pruned.

📦 Installation Guide

1. Install System Dependencies

Lumen requires GTK 4, libadwaita 1, WebKitGTK 6.0, PyGObject, GLib 2.0, and AT-SPI2.

Ubuntu 24.04+ / Zorin OS 17 & 18 / Debian 12+ / Linux Mint

sudo apt update
sudo apt install -y \
  build-essential pkg-config git \
  libglib2.0-dev libatspi2.0-dev \
  python3 python3-gi python3-gi-cairo \
  gir1.2-gtk-4.0 gir1.2-adw-1 gir1.2-webkit-6.0

Fedora 39+ / RHEL 9+

sudo dnf install -y \
  gcc make pkgconf-pkg-config git \
  glib2-devel at-spi2-core-devel \
  python3 python3-gobject \
  gtk4 libadwaita webkitgtk6.0

Arch Linux / Manjaro

sudo pacman -S --needed \
  base-devel pkgconf git \
  glib2 at-spi2-core \
  python python-gobject \
  gtk4 libadwaita webkitgtk-6.0

Note on Accessibility Bus (AT-SPI2): Lumen uses the standard GNOME AT-SPI2 bus to detect which application is focused without reading window titles. Ensure desktop accessibility is active (enabled by default on Zorin OS and Ubuntu):

gsettings set org.gnome.desktop.interface toolkit-accessibility true

2. Install Lumen

Option A: Install from Prebuilt Release (v1.0.1 — Recommended)

Download the latest release archive for Linux x86_64 and run the installer:

curl -fL https://github.com/hurairamuzammal/linux-lumen/releases/download/v1.0.1/lumen-v1.0.1-linux-x86_64.tar.gz -o lumen-v1.0.1-linux-x86_64.tar.gz
tar -xzf lumen-v1.0.1-linux-x86_64.tar.gz
cd lumen-v1.0.1-linux-x86_64
./scripts/install.sh

Option B: Clone & Build from Source

git clone https://github.com/hurairamuzammal/linux-lumen.git
cd linux-lumen
chmod +x scripts/install.sh scripts/lumen
./scripts/install.sh

Ensure ~/.local/bin is in your PATH (standard on most distributions):

export PATH="$HOME/.local/bin:$PATH"

3. Verify Installation

Check that the background collector service is active and recording:

systemctl --user status lumen-collect.service
lumen status

Launch the desktop app from your application launcher (Activities → Lumen) or run:

lumen

4. Uninstallation

To stop the collector service and remove all installed binaries, icons, and desktop entries from ~/.local:

make uninstall

(Your personal history in ~/.local/share/lumen and settings in ~/.config/lumen are preserved unless you delete them manually with rm -rf ~/.local/share/lumen ~/.config/lumen.)


🖥️ CLI & Service Usage

Usage: lumen [COMMAND]

Commands:
  (none)              Launch the Lumen GTK 4 / libadwaita desktop app
  status, --status    Print the collector's live current.json snapshot
  collect, --collect  Run the lumen-collect background daemon directly
  version, --version  Print version information (Lumen 1.0.0)
  help, --help        Show help message

Direct Collector Diagnostics

You can test a single poll cycle in your terminal without touching the running daemon or modifying day files:

~/.local/bin/lumen-collect --once
# Example output:
# app=code pid=41820 ram_kb=384120 idle_ms=0 locked=0 batt=84 status=0 power_mw=11400 suspend_sec=0

Configuration Files

Lumen stores its configuration in ~/.config/lumen/:

  • ~/.config/lumen/collector.conf (picked up live on the next poll tick via mtime check):
    # lumen collector
    idle_sec=180
    poll_sec=8
    paused=0
    • idle_sec: Seconds of user inactivity before transitioning from active to idle (clamped between 30 and 3600, default 180).
    • poll_sec: Poll interval in seconds (clamped between 3 and 60, default 8).
    • paused: 1 when tracking is paused, 0 when active.
  • ~/.config/lumen/ui.json:
    {
      "display_name": "Huraira",
      "theme": "system"
    }

🔒 Privacy & Security

Recorded Locally (~/.local/share/lumen) Never Recorded or Accessed
✅ Focused application name (e.g., Firefox, VS Code) ❌ Window titles, browser tabs, or document names
✅ Session state (active, idle, lock, sleep) ❌ Keystrokes, mouse coordinates, or clipboard text
✅ Focused process RSS memory (ram_kb) ❌ Screenshots, camera, or audio
✅ Battery percentage, status, and power draw (mW) ❌ Network traffic, telemetry, or cloud sync

Security Hardening in v1.0.0

  • Strict File Permissions (0700 / 0600): Both lumen-collect (umask(0077)) and lumen_store.py enforce 0700 directory permissions and 0600 atomic file writes so other local users on a shared system cannot read your activity history.
  • Binary Hardening: lumen-collect is compiled with -fstack-protector-strong, -D_FORTIFY_SOURCE=2, -fPIE, and linked with full RELRO (-Wl,-z,relro,-z,now -pie).
  • WebView Isolation: The GTK 4 WebKit view disables universal access from file URLs (set_allow_universal_access_from_file_urls(False)), disables developer extras in production, and enforces a strict navigation policy (decide-policy) that blocks any navigation outside the local index.html bundle.
  • PID Verification: Before sending SIGTERM when pausing tracking, Lumen verifies /proc/<pid>/comm matches lumen-collect, preventing accidental signaling of recycled PIDs.
  • Systemd Sandboxing: lumen-collect.service runs as an unprivileged user unit with NoNewPrivileges=yes, PrivateTmp=yes, LockPersonality=yes, and MemoryMax=32M.

See SECURITY.md for full details and vulnerability reporting.


❓ Frequently Asked Questions (FAQ)

How do I track screen time on Linux (Ubuntu, Fedora, Arch, Zorin OS)?

Install Lumen via ./scripts/install.sh. Lumen automatically sets up a lightweight background daemon (lumen-collect) running via systemd. It tracks active app usage, idle time, lock screen, and system suspend without any configuration needed.

Is there an Apple Screen Time or Android Digital Wellbeing equivalent for Linux?

Yes. Lumen is purpose-built to provide the exact visual clarity and analytics of Apple Screen Time and Android Digital Wellbeing on the Linux desktop—including daily activity rings, stacked weekly bar charts, 12-month calendar heatmaps, and weekly reflection letters.

How does Lumen compare to ActivityWatch?

While ActivityWatch is a popular tool, it runs continuous Python/Electron servers that consume 150–250 MB of RAM and scrapes window titles and browser URLs. Lumen's C11 collector uses only ~3–5 MB of RAM, causes zero battery drain, and strictly protects your privacy by never reading window titles, URLs, or keystrokes.

Does Lumen work on Wayland?

Yes, 100% natively. Most older Linux time trackers rely on X11 xprop or xdotool which fail under Wayland security boundaries. Lumen communicates directly with GNOME's Mutter D-Bus org.gnome.Mutter.IdleMonitor and the standard AT-SPI2 accessibility bus, making it fully compatible with pure Wayland sessions.

How can I check battery health and discharge wattage on my Linux laptop?

Open Lumen and navigate to the Battery tab. Lumen queries /sys/class/power_supply to graph your real-time charge and discharge curves, live power draw in watts (W), full capacity degradation (Wh), factory design capacity, battery health percentage (%), and remaining charge/discharge time estimates.

Can I pause tracking during private sessions?

Yes. Open Lumen, click the header menu icon (☰), and select Pause tracking. Lumen stops the background service completely until you choose to resume it.


🛠️ Development & Testing

# 1. Compile the native C11 collector
make collect

# 2. Run the unit test suite (7-day calendar, live slice folding, pause & security tests)
make test

# 3. Build a distributable release tarball + SHA-256 checksum in build/
make dist

Project Layout

linux-lumen/
├── src/
│   └── lumen-collect.c                  # Native C11 background collector daemon
├── ui/
│   ├── lumen_app.py                     # GTK 4 + libadwaita + WebKitGTK 6 application shell
│   ├── lumen_store.py                   # Binary .lmn parser, sysfs battery reader, rollup & state engine
│   └── web/
│       ├── index.html                   # Dashboard entry point
│       ├── app.js                       # Views, canvas charts, fuzzy search & live DOM patching
│       ├── styles.css                   # Responsive styles & dynamic theme tokens
│       └── fonts/                       # Bundled offline fonts (Outfit, Caveat, Permanent Marker)
├── scripts/
│   ├── install.sh                       # One-step builder, installer & systemd user unit configurator
│   └── lumen                            # CLI launcher wrapper
├── packaging/
│   ├── org.lumen.Wellbeing.desktop      # XDG desktop entry
│   ├── icons/org.lumen.Wellbeing.svg    # Scalable app icon
│   └── systemd/lumen-collect.service    # Hardened systemd user service unit
├── tests/
│   ├── test_calendar.py                 # 7-day .lmn & 12-month rollup unit tests
│   ├── test_live.py                     # Live open-slice folding tests
│   └── test_pause.py                    # Service pause/resume & security hardening tests
├── Makefile                             # Build, test, install, uninstall & dist targets
├── SECURITY.md                          # Security architecture & reporting policy
└── LICENSE                              # MIT License

🔍 Search Keywords & SEO Index

linux screen time · digital wellbeing linux · gnome screen time app · activitywatch alternative linux · rescuetime alternative open source · apple screen time for linux · android digital wellbeing linux · wayland screen time tracker · battery health linux laptop · battery discharge wattage meter · linux app usage tracker · c11 lightweight daemon · libadwaita wellbeing app · gtk4 screen time · zorin os digital wellbeing · ubuntu screen time tracker · arch linux screen time · fedora screen time monitor


📄 License

Released under the MIT License. Bundled fonts in ui/web/fonts/Carry their respective Open Font License (OFL) and Apache notices.

About

Native, privacy-first digital wellbeing & battery telemetry for Linux (GNOME / Zorin OS) — ~32 KB C11 session collector + GTK 4 / libadwaita dashboard

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages