Skip to content

About

Local screen-time and activity tracker for KDE Plasma on Wayland, in Rust. Apps, sites, terminals and AI agents; nothing leaves your computer.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

arch-tracker

CI Release License: MIT

Screen time for KDE Plasma, GNOME, Hyprland, Sway and niri on Wayland. arch-tracker records which app has your focus, which sites you use (with subdomains kept apart), what runs in your terminal, and how long your AI coding agents work, then shows it all in a local dashboard with a tray icon. It runs as a small user service (under 20 MB of memory, close to 0 % CPU) and nothing leaves your computer.

Now: the focused window with a live timer, the windows beside it, agents, media and the tracker's health

What it records

Source What you get How
Windows The focused app and window title, to the second; windows that sit visible beside it On Plasma a KWin script, loaded at runtime (your kwinrc is not touched); on GNOME a small Shell extension; on Hyprland, Sway and niri their IPC sockets
Browser The active tab's host and page title; each subdomain separate A small extension for Chromium-based browsers (Brave, Chrome, Chromium, Helium, Vivaldi, Edge, Opera…) and Firefox-based ones (Firefox, Zen, LibreWolf, Floorp, Waterfox), over native messaging. Plasma Browser Integration and Chromium's session file are fallbacks
Incognito Time only, counted as "Private browsing" Hosts and titles from private windows are never stored
Terminals The program in front of you and its project (git root) kitty remote control (exact tab); /proc for ghostty and others; tmux panes
AI agents Per tool and project: time you watched it, and time it was working Claude Code, Codex, opencode, Antigravity, Cursor Agent, Hermes, Gemini CLI, Aider and more, matched by name
Claude Code cost What its requests would cost at Anthropic's API prices, per day, model and project, on its own page Token counts from Claude Code's own transcripts and statistics, read-only: prompts and replies are never kept
Hermes cost The same for Hermes Agent, per model Token counts per session and model from Hermes's own database, read-only
opencode cost The same for opencode, per response, model and project; free and stealth models show as free Token counts per response from opencode's own database, read-only
Codex cost The same at OpenAI's list prices, plus its plan's limits Token counts from Codex's session logs, and for conversations whose logs Codex has removed, the token totals in its own database (an estimate), read-only
Idle Gaps with no keyboard or mouse input Wayland ext-idle-notify v2
Watching and calls Video playing in a visible window; microphone open MPRIS players, the browser extension, and the ALSA capture state
Background Music in a hidden tab; apps open in the tray but unused Shown separately, never added to screen time

The dashboard

  • Now: what has your focus this moment, with a millisecond timer, the windows beside it, terminals, AI agents and their CPU, media, input and lock state, and connected browsers. It updates the instant focus changes.
  • Today: the day as five-minute bars, screen time against your goal, categories against their limits, apps, sites, coding projects, agents and focus stats (longest stretch, deep work, switches).
  • Timeline: every session (a stretch on one app, site or project) with its exact start and end, filterable and searchable.
  • Projects: coding time per project from terminals, code editors and agents.
  • Browsers: a sidebar group with every browser the extension has connected from (Brave, Zen, Helium…), each with its own icon, today's time and a dot while its extension is connected, and All browsers on top once there are two. A browser's page groups its sites by domain, then subdomain, then page title, with the hours of the day each was used; adds background audio and private-window time; and lists each visit of a day with its exact start and end and what came right before and after it.
  • Agents: a sidebar group for Claude Code and Codex (and Hermes once it is installed), with All agents on top. An agent's page shows the time it worked beside the time you watched it, per project and per hour or day, your sessions in its terminal with what came before and after, and its stretches of work. Claude Code and Codex add what their requests would cost at API prices (by day, kind of token, model and project), and Codex its plan's 5-hour and weekly limits.
  • Apps and sites and Trends over a day, a week, a month or a year.
  • Week: a week against the one before, day by day, with categories, apps, sites, agents and their cost; a notification on the first morning of each week sums up the last one.
  • Alerts: desktop notifications (with a sound) for category limits, your daily goal, breaks, Codex's plan limits at the share you choose, and the weekly summary; and when an AI agent you aren't looking at finishes or waits for your answer, with a click that takes you back to its terminal tab.

The Claude overlay

While a Claude Code session is open, Clawd (the Claude Code mascot) sits on top of every window, fullscreen ones too, and shows what Claude is doing:

Clawd Claude Code
Asleep The session is open, between turns
Building, hammer in hand Working on your prompt
Blinking a beacon Needs you: a permission prompt, a question or plan to approve, an MCP form, or another dialog
Celebrating Finished, until you look at that session (its tab in front while you use the keyboard or mouse after it finished; one that finishes in the tab in front, or that you come back to, celebrates 10 seconds first; a restart doesn't forget it)
Watching the clock Its turn ran into your usage limit: until the limit resets (the label says when) or Claude goes on
Small Clawds below him Its subagents at work: each comes out of him, builds while it works, celebrates when it is done and goes

Those are the usual pictures: each state, and the small Clawds, can play any of clawd-pet's 148 animations. Pick them on the Claude Code page's Clawd tab, where every one plays as it will on screen, the ones that suit a state first.

  • Click him to jump straight to that session: the kitty tab and split, the tmux window and pane, or the Ghostty tab, with its window raised.
  • Drag him anywhere: he stays exactly where you leave him and hangs from the corner nearest to him. Scroll over him to make him bigger or smaller, and right-click him for his settings. His × hides him until you pick Show Claude overlay in the tray menu (or run arch-tracker overlay show).
  • With several sessions open he shows the one that wants you most (needs you, then done, then working, then waiting for the usage limit, then asleep; the longest waiting first) and a click opens it. His grey number says how many sessions are open, the orange one how many want you (need you or are done). Rest the pointer on him for a list of every session, each with a small Clawd in its state, its project and what it is doing; click one to open that exact tab. Hover over a small Clawd below him to see a subagent's task; more than four show as "+n". The Clawd tab can give each session its own Clawd instead, and sets his size, the label (on hover by default), the frame rate and the animations; changes apply at once.

Clawd follows the status Claude Code itself keeps for every session in ~/.claude/sessions (busy, waiting for you and why, idle; the file goes away when the session ends). arch-tracker watches that folder, so there is nothing to install or set up, a change reaches Clawd within milliseconds, and nothing is spent while nothing changes. Subagents come from the small file Claude Code keeps for each one beside the session's transcript (subagents/agent-<id>.meta.json: its type, its task, finished or stopped), watched the same way. A turn that ran into the usage limit is known from the end of the session's transcript, where Claude Code notes the limit and when it resets: only those two fields of its last answer are read, when a turn ends. Sessions of a Claude Code too old to keep that status are shown asleep rather than guessed at.

Sessions in the Claude app's Code tab show too (Claude Code keeps their status in the same place): while the Claude window is in front and you are there, its finished sessions count as seen, and a click on Clawd opens that very session in the app (claude://code/continue, from the app's own note naming its id for the session).

Codex sessions join the same Clawd, ranking, numbers and list. Codex runs each terminal session inside its own background server, and the overlay listens on that server's local socket for what each conversation is doing (working, waiting for your approval or your answer, done, stopped on an error, or out of its plan's limit) and its folder; it never starts, resumes or answers one. Codex in the ChatGPT app runs on the same server, so its conversations show too: each from when it starts working until you have seen it finish (the ChatGPT window in front while you are there, or a click, which opens that conversation in the app). A Codex session plays a Codex pet if you pick one on the Codex page's Pet tab: running while it works, waving when it needs you, jumping when done. Pick one of yours (~/.codex/pets, WebP or PNG sheets) or find one in the community gallery (petdex.dev, reached only when you search it); installing puts it in ~/.codex/pets, where Codex's own pet settings find it too. Without a pet, a Codex session is Clawd with Codex's mark.

The overlay draws with Wayland's layer shell (KDE Plasma, Hyprland, Sway and niri; GNOME has none). The pictures are fan-made Clawd animations from clawd-pet (MIT), played by a small built-in SVG animation player, checked frame by frame against Chromium's drawing of all 148. Each frame redraws only the pictures that moved, straight into the buffer the compositor reads; the label, the list and the badges are drawn once, again only when they change. A burst of pointer motion is read at once, and dragging moves him without drawing.

How screen time is decided

arch-tracker stores raw facts (focus, no-input gaps, media, microphone, lock, suspend) and decides what counts when you look at the data:

  • Active: you are using the computer, or paused for less than the idle threshold (3 minutes).
  • Watching: no input, but video or audio plays in a window you can see. No time limit.
  • Call: the microphone is open. Up to 5 minutes without input still counts.
  • Idle: everything else is removed, back to your last input.

Change a threshold in Settings and every past day is re-classified.

Today: screen time against a daily goal, the day in five-minute bars, categories, apps, sites and coding projects
Timeline: every session with its exact start and end Projects: editor, terminal and agent time per project, with a daily sparkline
Trends: screen time per day by category Today in the OLED theme's light mode
A browser's page: its sites grouped by domain with the hours each was used, time per day, categories, background audio and private windows
An agent's page: the time Claude Code worked and you watched, per project and day, with what its requests would cost
Week: screen time day by day against the week before, with categories and top apps
Codex: cost at OpenAI's list prices, part of it estimated from conversations whose logs Codex removed, and its plan's limits

Screenshots use made-up data (arch-tracker demo) in the OLED theme; node scripts/screenshots.mjs regenerates them.

Install

Requires Arch Linux (or a derivative) on x86_64 or aarch64 (ARM64), with KDE Plasma 6, GNOME 45 to 51, Hyprland, Sway or niri on Wayland (see GNOME and Hyprland, Sway and niri for what differs there). On any other desktop (COSMIC, labwc, river, Wayfire, X11 sessions) windows can't be read, which arch-tracker doctor says; idle time, media, terminals and agents still work.

From a release: download arch-tracker-<version>-1-x86_64.pkg.tar.zst (or -1-aarch64.pkg.tar.zst on ARM64) from Releases and install it:

sudo pacman -U arch-tracker-*-"$(uname -m)".pkg.tar.zst

From source:

git clone https://github.com/abhimangs/arch-tracker.git
cd arch-tracker/packaging
makepkg -si

AUR packages (arch-tracker and arch-tracker-bin) are ready in packaging/aur for when they are published there.

What starts it is a systemd user session: the package's user unit waits for graphical-session.target, which Plasma, GNOME, and Hyprland or Sway under uwsm start. On a system without systemd (Artix with OpenRC, runit, s6 or dinit, plus elogind) the package's autostart entry, /etc/xdg/autostart/arch-tracker.desktop, runs arch-tracker daemon from the session instead; where nothing runs autostart entries, add arch-tracker daemon to the compositor's startup. On a systemd system the entry does nothing (--autostart), so only the unit starts it, and a second copy exits at once anyway. A daemon started that way ends with its session (when its session bus or Wayland display goes away), so the next login starts a fresh one. See Hyprland, Sway and niri for bare compositors.

Then, as your own user (on a system without systemd, log out and in instead of the first line):

systemctl --user enable --now arch-tracker
arch-tracker setup     # registers the browser bridge and prints the extension steps
arch-tracker doctor    # checks every source and says how to fix problems

Open the dashboard from the tray icon, or run arch-tracker open. It lives at http://arch-tracker.localhost:7600/ and is locked to you: the tray icon and arch-tracker open sign your browser in once, after which bookmarks work too. Other programs on the computer can't read it.

Browser extension

For exact tabs, add the extension once to each browser you use. arch-tracker setup registers the bridge in every installed browser and prints these steps.

Chromium-based (Brave, Chrome, Chromium, Helium, Vivaldi, Edge, Opera, Thorium):

  1. Open brave://extensions or chrome://extensions and switch on Developer mode.
  2. Click Load unpacked and choose /usr/share/arch-tracker/extension.
  3. The extension ID must be ofgofljkhfmjkgklekeiajnkplaldokg.

Firefox-based (Firefox, Zen, LibreWolf, Floorp, Waterfox): Firefox and Zen keep only add-ons signed by Mozilla. Sign your own copy once, privately (nothing is published):

  1. Create an API key at https://addons.mozilla.org/developers/addon/api/key/ and save it in ~/.config/arch-tracker/amo.env (then chmod 600 it):
    AMO_JWT_ISSUER=user:12345:67
    AMO_JWT_SECRET=…
    
  2. Run scripts/sign-firefox.sh from a checkout, and open the .xpi it prints in your browser.

LibreWolf, Floorp, Waterfox and Firefox Developer Edition also accept the unsigned add-on after setting xpinstall.signatures.required to false in about:config. For a quick test in any of them, about:debugging → Load Temporary Add-on → /usr/share/arch-tracker/extension-firefox/manifest.json works until the browser restarts.

Flatpak and Snap browsers can't start the bridge from their sandbox; their windows are still tracked through the fallbacks. Without the extension, tabs are matched by window title through Plasma Browser Integration, which can mix up two tabs with the same title.

GNOME

arch-tracker setup switches on the arch-tracker Shell extension (the package installs it to /usr/share/gnome-shell/extensions). GNOME on Wayland loads new extensions at login, so log out and back in once. The extension only tells the daemon on this computer which windows there are and which has focus, the same as the KWin script does on Plasma. Idle time comes from GNOME's own idle monitor. The tray icon needs the AppIndicator extension (gnome-shell-extension-appindicator), and Plasma Browser Integration is Plasma's only.

Hyprland, Sway and niri

The tracker finds the compositor on its own. Its service starts with graphical-session.target, which uwsm (Hyprland, Sway and others) and sway-systemd (Sway) start for you. A compositor started from a tty, ly, greetd or emptty, or from a login manager's plain session, does not start it: the service stays enabled but inactive, and arch-tracker doctor says so. Start the compositor with uwsm, or start the service from the compositor's config, which also hands it the session's variables:

-- hyprland.lua (Hyprland 0.57 and later; it usually starts the session target by itself)
hl.on("hyprland.start", function() hl.exec_cmd("systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP HYPRLAND_INSTANCE_SIGNATURE && systemctl --user start arch-tracker") end)
# hyprland.conf (before 0.57)
exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP HYPRLAND_INSTANCE_SIGNATURE && systemctl --user start arch-tracker
# sway config
exec systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP SWAYSOCK && systemctl --user start arch-tracker
# niri config.kdl
spawn-at-startup "sh" "-c" "systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP NIRI_SOCKET && systemctl --user start arch-tracker"
# any other compositor, from its startup
systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP && systemctl --user start arch-tracker

niri's windows come from its event stream, so each change reaches the tracker at once; it finds the socket from NIRI_SOCKET or the one niri left in $XDG_RUNTIME_DIR.

Idle time, media, terminals, agents and the browser extension work as on Plasma. The tray icon needs a StatusNotifierItem tray (Waybar's tray module), notifications need a notification daemon (mako, dunst, SwayNC), and Plasma Browser Integration is Plasma's only. hyprlock, swaylock, gtklock and waylock don't tell anyone the screen is locked, so a running one counts as the lock: from the moment it starts (the tracker watches their programs being run) until it ends, both seen at once.

kitty

kitty is read exactly when remote control is on. Add to kitty.conf:

allow_remote_control socket-only
listen_on unix:/tmp/kitty.sock

Nix

The flake builds the same files as the Arch package (the binary, the systemd user unit, the browser bridge, the GNOME extension and the man page) for x86_64 and aarch64 Linux:

nix build github:abhimangs/arch-tracker       # result/bin/arch-tracker
nix run github:abhimangs/arch-tracker -- doctor
nix develop github:abhimangs/arch-tracker     # cargo, clippy and rustfmt

On NixOS, add the package and a user unit to your configuration (the unit does what the Arch one does):

{ inputs, pkgs, ... }:
let
  arch-tracker = inputs.arch-tracker.packages.${pkgs.system}.default;
in {
  environment.systemPackages = [ arch-tracker ];
  systemd.user.services.arch-tracker = {
    description = "arch-tracker screen-time and activity tracker";
    partOf = [ "graphical-session.target" ];
    after = [ "graphical-session.target" ];
    wantedBy = [ "graphical-session.target" ];
    serviceConfig = {
      Type = "notify";
      ExecStart = "${arch-tracker}/bin/arch-tracker daemon";
      Restart = "on-failure";
      RestartSec = 5;
      Nice = 10;
    };
  };
}

The browser steps are the same: run arch-tracker setup as your own user.

Commands

Command What it does
arch-tracker open [page] Open the dashboard in your browser, signed in (today, apps, agents, trends, settings)
arch-tracker status What is tracked right now and which sources work
arch-tracker today [--date yesterday] [--json] The day in the terminal: screen time and goal, categories and limits, top apps and sites, projects, and agents with their cost
arch-tracker pause 1h / arch-tracker resume Pause recording; no duration pauses until you resume
arch-tracker doctor Check every source, with fixes
arch-tracker export --from 2026-11-01 --to 2026-11-22 --format csv Every recorded interval, as CSV or JSON
arch-tracker serve --db copy.db A read-only dashboard for any database, without tracking
arch-tracker setup Unpack the extensions and register the bridge in every installed browser
arch-tracker overlay [show|hide|reset|status] The Claude overlay: show it again after its ×, hide it, move it back to the top right, or see its state

Configuration

Settings live in ~/.config/arch-tracker/config.toml and on the dashboard's Settings page. Both are picked up live. You can change:

  • idle and call thresholds, and what counts as watching
  • categories (sites, apps and programs; the most specific site wins)
  • AI agent names to recognise, and when an agent counts as working; whether to show Claude Code's cost, and your own prices ([agents.prices]) for models the built-in table lacks
  • apps and sites never to record
  • categories, apps and sites never to record, project renames and "not a project" can also be set from a row's ⋯ menu on Today, Apps and sites, and Projects, without opening Settings
  • the dashboard port (applied at once, whichever way you change it), your own CSS and the tray icon
  • the page it opens on, a 12- or 24-hour clock, milliseconds on live timers, density and motion
  • a daily screen-time goal, per-category daily limits, what counts as a session and as deep work
  • desktop notifications: a heads-up before and a notice at each category limit and the daily goal, and a reminder to take a break after a long stretch on screen (it waits until a call or a video ends), and agents that finish or wait for you. One switch turns all of them off, and Settings can send a test notice
  • which apps are code editors, project renames, and which folders are projects: parent folders (every folder inside one is a project) and single project folders, git repository or not, picked from a folder browser that also suggests the folders you worked in; and folders that aren't projects
  • the Claude overlay: on or off, one Clawd for all sessions or one each, his size, the label and the frame rate ([overlay])
  • how many days of history to keep, and recomputing past days after changes the cache can't notice
  • the look: OLED (true black, the default, with a Paper light mode), Catppuccin (Mocha, Macchiato, Frappé, Latte), Rosé Pine (Main, Moon, Dawn) or the original Aizome, any of their accents, following the system or fixed dark or light. Category colours follow the theme unless you switch that off. The palette button in the header switches it instantly.

Privacy

  • Data lives in ~/.local/share/arch-tracker/tracker.db and is never sent anywhere.
  • The dashboard answers only on 127.0.0.1 as arch-tracker.localhost, refuses other host names, and is locked: without the sign-in cookie it shows nothing, so other programs and other users can't read your history. Every change also needs a per-run token.
  • Browsers send host and title only: no paths, no query strings (untitled pages that show their URL are reduced to the host), and from private windows only that time was spent.
  • Terminals give program name and project only: never arguments, window titles (which shells set to the running command) or environment variables.
  • arch-tracker pause stops recording; the exclude list hides chosen apps and sites.
  • Claude Code's transcripts (~/.claude/projects) and statistics (~/.claude/stats-cache.json) are only read: opened read-only, never written, renamed or locked, without following links and without even updating their access time. From each request only the model, its time, its token counts and its folder are kept; prompts, replies and file contents are never stored. Claude Code deletes transcripts after 30 days by default (cleanupPeriodDays); arch-tracker keeps the counts. Switch it off under Settings → AI agents.
  • The Claude overlay reads only each session's status, kind and folder from Claude Code's ~/.claude/sessions, and each subagent's type, task title and whether it finished from its .meta.json (read-only; only what each session shows is kept, to survive a restart), never what a session or an agent says. To jump to a Ghostty tab, Ghostty's surface id is read from Claude's environment at the click and forgotten.
  • For Codex sessions the overlay asks Codex's local server only which conversations are open, their folders and their states; nothing they say is read. For a Claude app session, the app's own note is read at a click for two ids. The pet gallery (petdex.dev) is reached only when you search or install from it on the Codex page's Pet tab: its list, at most once a day, and the pet's two files.

See SECURITY.md for the threat model and how to report a problem.

Resource use

Measured on a running daemon after three hours: about 18 MB resident, of which about 6 MB is its own memory (the rest is the executable and the system libraries it maps, shared with other programs), and about 0.1 % of one core (16 seconds of CPU in those three hours). The dashboard server idles inside the same process at no measurable cost, and the tray icon uses the existing D-Bus connection. The systemd unit caps memory at 64 MB.

The whole app stays under half a percent of one core in every state, and idles at about 0.02 %: nothing runs on a timer while nothing changes. While the screen is locked or you are away (no keyboard or mouse for the idle threshold), the tracker looks at its windows and terminals not at all and at running programs once a minute instead of every 10 seconds; media players, the tray and the readers of Claude Code's, Codex's, opencode's and Hermes' records act only when something changes.

The Claude overlay costs nothing while no session is open, holds still at no cost while the screen is locked or you are away, and hides while a fullscreen window is in front. On screen he is drawn at 10 to 15 frames a second, evenly spaced, so he never stutters: about 0.2 % of one core while he builds at 15 frames a second, 0.25 % asleep, 0.35 % celebrating and 0.4 % with his beacon (measured at 64 px on a 1024 x 768 screen; a bigger Clawd costs more). A governor skips frames evenly when his thread uses more than 0.2 % (a bigger Clawd, a higher frame rate), but never below 10 a second. He needs 1 to 3 MB of memory.

How it works

One Rust binary runs as a systemd user service. Event sources (the window manager, Wayland idle, logind, MPRIS, the browser bridge, terminals) feed a single tracker that opens and closes intervals in SQLite, writing in batches every 30 seconds. The dashboard is served by the same process from embedded files. Windows come from whichever desktop runs: a KWin script on Plasma, a Shell extension on GNOME, or Hyprland's, Sway's and niri's IPC sockets; each becomes the same snapshot of windows, so everything after it is shared.

Contributing

See CONTRIBUTING.md. Changes are listed in CHANGELOG.md.

License

MIT

About

Local screen-time and activity tracker for KDE Plasma on Wayland, in Rust. Apps, sites, terminals and AI agents; nothing leaves your computer.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages