Skip to content

Dozed · Version 0.1 · Linux

Out of sight, sound asleep.

Dozed freezes the apps you are not looking at, so they stop waking your CPU, and thaws them the instant you switch back. Your Linux desktop runs cooler and quieter, and a laptop lasts longer on battery.

installs under your home
No root
until you switch it on
Dry-run
no account, no telemetry
Free
Sleep study0 held · 09:00

A time-lapse of six apps on one Linux desktop. The app in front keeps running. Hidden apps count down a grace period, then Dozed freezes the idle ones and caps the chat apps at 5% of a core. An app that is playing music and a terminal running a build are left alone. Switching back to a frozen app thaws it at once.

hidden and awake dozing left alone

The problem

Hidden is not idle.

A chat app you minimised an hour ago is still running timers, redrawing and polling, sometimes hundreds of times a second. Each wakeup pulls the CPU out of its deepest sleep, so the machine never really rests. It stays warm, the fan runs, and the battery drains for work nobody asked for.

Dozed counts wakeups rather than CPU use. A busy core is usually a build or an export you started. A hidden app that keeps waking up is the waste.

CPU sleep · how deep it gets to rest

One hidden app keeps waking it

AwakeDeep sleep

The same app, dozing

AwakeDeep sleep
A drawing, not a measurement. The CPU sinks towards deep sleep only while nothing wakes it, and every wakeup sends it back to the top.

Laptop on battery

Runtime you can feel

The lower the charge, the sooner Dozed acts. At half charge it waits half as long, and at 10% a five-minute rule fires after thirty seconds.

Laptop plugged in

Heat, fan noise and frames

A wasted wakeup costs the same power from a charger. Dozed still acts when plugged in, with twice the patience.

Desktop

The most over a week

A desktop is never unplugged, rarely suspended and often left overnight with a browser and a chat client open.

The film

The whole idea in 30 seconds.

Turn the sound on. Every click is one wakeup, so you can hear what a hidden app does to your CPU, and what it sounds like once Dozed has frozen it.

Every click in the film is one wakeup. The 165 wakeups a second falling to 0 at the start is the measured figure, played at real speed. The six apps are a time-lapse with illustrative rates, and their total is the sum of those rates.

Try it

Switch apps. Watch the rest doze.

Six apps on one desk, with a minute passing every second. Bring another app to the front from the taskbar and see what Dozed decides about the ones left behind. It starts in dry-run, as the real one does.

Mode
Aggression
Power

Dry-run, the default. Dozed is only taking notes. Bring another app to the front and wait.

code · Editor · in front
Dozed tray icon: idle09:00
64/s
240/s
900/s
130/s
310/s
85/s

No decisions yet. Hidden apps are still inside their grace period.

The wakeup rates here are illustrative, and the model is simplified: the real one also waits four times longer while you are typing, and backs off for apps you keep coming back to. The rules, timings and output formats are the ones Dozed ships.

Proof

It does nothing until you say so.

We could print a battery percentage here and ask you to believe it. Dozed measures your machine instead, with your apps, and tells you what it finds before it touches anything.

  1. 01

    Install it. Nothing changes.

    Dozed starts in dry-run. It watches which apps are hidden, works out what it would have done, writes that down and touches nothing.

    $ systemctl --user enable --now dozed.service

  2. 02

    Read what it would have done.

    After a day, the report lists every app it would have held, for how long, and the wakeups and CPU time that would have been avoided, sampled from the real processes.

    $ dozectl report

  3. 03

    Run the experiment.

    A trial alternates live and dry-run in randomised pairs while the desktop is idle and compares the actual battery discharge. On a desktop it can judge by the CPU's own energy counter instead.

    $ dozectl trial start

  4. 04

    Switch it on.

    Going live is one command, and there is no way to get there by accident. An app you are unsure of can stay in monitor mode while the rest run live.

    $ dozectl mode live

$ dozectl report --since 24hExample output
Over the last 24h, dozed would have:
held 6 apps for a total of 4h12m of app-time — 3h30m frozen, 42m throttled
something was held for 2h51m of that window; apps overlap, so the
total above counts each one separately
avoided ~310 CPU-seconds and ~2.1M wakeups
com.slack.Slack 1h40m ~ 120 CPU-s ~890k wakeups
com.discordapp.Discord 1h2m ~ 74 CPU-s ~610k wakeups
...

The trial can say

“measured saving”

A number with a confidence interval, claimed only when the interval excludes zero and p is under 0.05. Six live and dry-run pairs is the fewest that can get there, so a trial takes an evening.

The trial can say

“no measurable difference”

Printed just as plainly, with the sign, when your machine does not show a saving. A tool that can only report good news is not measuring anything.

Safety

It leaves alone anything someone can hear or see.

A frozen music player is a fault you notice and fix in a second. A frozen microphone is one only the people on the call can hear. So every one of these is a watched signal, and each ships as a named rule you can read.

  • Anything you can hear

    An app that is playing sound keeps running, hidden or not.

    audio-exempt

  • A live microphone or camera

    Calls, dictation and recorders are left alone for as long as they hold the mic or the camera.

    capture-exempt

  • A shared screen

    The app doing the sharing is exempt, and so is every window that was on screen when the share began.

    screencast-exemptshared-window-exempt

  • Fullscreen video and games

    Whatever has the whole screen is never held.

    fullscreen-exempt

  • Builds and long jobs

    A terminal with a live child process is doing work you asked for. So is anything that has asked the system not to sleep.

    long-job-exemptinhibitor-exempt

  • VMs, sync and backups

    Virtual machines, containers, Syncthing, Nextcloud, Dropbox, torrent clients and backup tools ship on a never list.

    never-vm-container-sync

  • Password managers and prompts

    KeePassXC, Bitwarden and 1Password stay ready to fill, and an authentication prompt is never frozen under you.

    never-password-managersnever-security-prompts

  • Remote desktop

    RustDesk, AnyDesk, TeamViewer, VNC and RDP are capped and never frozen, so the machine stays reachable.

    throttle-remote-hoststhrottle-remote-clients

  • A window you can see

    Only hidden apps are candidates: minimised, on another workspace or fully covered. A visible window is left alone unless you opt that one app in.

    freeze_visible = false

And when something goes wrong

Six rules that have no setting.

These are in the code, so no config file can switch them off.

  1. The session itself is off limits.

    The compositor, systemd, D-Bus, PipeWire and the portals are refused at the last step, whatever a rule says.

  2. If the daemon stops, everything thaws.

    On a clean exit, a crash or a kill. The held set is written to disk before each freeze, and the next start releases anything left over.

  3. Before the system suspends, everything thaws.

    Timers reset on wake, so a night asleep does not count as eight hours hidden.

  4. If it loses sight of your windows, it lets go.

    A compositor helper that stops answering means nothing stays held.

  5. One command undoes it all.

    dozectl thaw --all ignores every rule and the mode. The same button is in the tray menu.

  6. Only your own processes.

    Dozed never touches a process owned by another user, and never asks for root.

Actions

Freezing is the last rung, not the only one.

A frozen chat app drops its connection and reconnects when it thaws. So Dozed has a ladder, and each rule picks its rung.

Rung 01

Cap it

action = { throttle = 5 }

A hard CPU limit, set through systemd. A chat app stays connected and still notifies you. It just cannot spin.

Measured A busy loop under a 5% cap used 4.97% of a core, down from 100%.

Rung 02

Cap it to a budget

action = { throttle-to = 50 }

Say how many wakeups a second an app is worth and the cap moves until it gets there. It never goes below 5%, and it says so when capping is not moving the rate.

Rung 03

Freeze it

action = "freeze"

The kernel's cgroup freezer stops the whole app at once. Where an app has no cgroup of its own, Dozed stops its process tree instead.

Measured 165 wakeups a second went to 0, and came back at 163 on thaw.

Rung 04

Freeze it, with air

action = { doze-cycle = { every = "15m", wake = "20s" } }

Frozen, then let up for a moment on a schedule shared with every other app doing the same, so they all reconnect in one burst. Stopped for 98% of the time.

Measured by the Dozed developers on KDE Plasma 6.6.6 with Linux 7.1. Every figure on this page comes from one or two machines, and yours will differ. That is what dozectl trial is for.

Tuning

One setting, four words.

How long an app must stay hidden before Dozed acts is one multiplication, and aggression is the only term you need to touch. Plugged in, the wait doubles. On battery it shrinks with the charge, so a nearly flat laptop acts in seconds.

The arithmetic is printed wherever a decision is, so you can check it instead of trusting it. Drag the charge and pick a cell.

aggressionPlugged in
gentle
balanced
aggressive
maximum

$ dozectl why firefox

grace 5m (base 5m x battery 1.0 x activity 1.0)

For the catch-all rule, which is what most apps hit. Prefer a window? The dashboard has every setting with its explanation beside it.

Explainable

Ask it why.

Rules are plain TOML. The first match wins, by explicit priority, and there is no scripting language. That constraint is what lets every action map to exactly one named rule, including when the answer is that nothing happened and here is the rule that is counting down.

~/.config/dozed/config.tomlA shipped rule
[[rule]]
name = "chatty-apps"
priority = 50
# capped, Slack stays connected
action = { throttle = 5 }
[rule.match]
app = ["slack", "com.slack.Slack"]
[rule.when]
visibility = "hidden"
for = "2m"
$ dozectl why slackEvery decision has one
slack (desktop=slack)
state throttled
visibility hidden
mode live
because hidden for 2m, grace 1m36s (base 2m x battery 0.8 x activity 1.0)
rule chatty-apps
grace 1m36s (base 2m x battery 0.8 x activity 1.0)
for 2m
observed hidden idle-present on-battery 80% cpu 8.1% wakeups 900/s
identity desktop=slack
rules (-> decided, * would match but outranked)
-> 50 chatty-apps matched
* 100 bg-idle matched, but a higher-priority rule won

Footprint

A power tool that shows its own bill.

Something that can stop your applications should be small, visible and easy to remove.

Unprivileged

No root, ever

The installer puts everything under your home directory, and --uninstall takes every piece back out while leaving your config and recordings alone.

Private

Nothing leaves the machine

No account, no telemetry and no update check. There is no network code in it: Dozed talks to your session bus and one local socket.

Rust

Unsafe code is forbidden

All five crates forbid unsafe Rust. The decision logic is a pure function with no I/O, so a recorded day can be replayed against a new config.

Measured

It shows its own cost

dozectl status prints the daemon's own wakeups per second. Across 135 real runs, systemd counted it using between 0.03% and 0.89% of one core.

Quiet

One notification a week

It says what dozing has been worth, and that is the only one. A tray icon shows what is held, with snooze and thaw one click away.

Honest

It says what it cannot see

Each safety signal is listed in dozectl status as reporting, unavailable here, or degraded because a utility is missing, with the package named.

The command line

dozectl status
The mode, what is held, and the daemon's own cost
dozectl watch
Decisions as they happen
dozectl why <app>
Why this app is in the state it is in
dozectl report
What dozing saved, or would have
dozectl trial
Measure whether it saves anything, by experiment
dozectl suggest
Search your own recorded day for a better config
dozectl export
The same numbers as Prometheus metrics
dozectl snooze 1h
Stop acting for a while, then carry on by itself
dozectl thaw --all
Restore everything, ignoring rules and mode

The tray icon

  • Idle
  • Holding apps
  • Snoozed

There is a dashboard too, dozed-gui, with a live timeline, per-app control and a config editor whose save button stays disabled while the file would not parse.

Install it tonight. Decide tomorrow.

Dozed 0.1 builds from source in a few minutes and runs as your own user. Nothing is held until you switch it to live.

TerminalNo sudo anywhere
# Build and install for your user. No sudo.
$ git clone https://github.com/amazynk/dozed.git && cd dozed && ./packaging/install.sh
# Start it. It begins in dry-run and touches nothing.
$ systemctl --user enable --now dozed.service
# A day later, read what it would have done.
$ dozectl report
# Convinced? Switch it on.
$ dozectl mode live

KDE Plasma

On Wayland, a small KWin script reports which windows are visible. The installer adds it. On X11 nothing extra is needed.

Developed and measured on Plasma 6.6

GNOME

On Wayland, a Shell extension for GNOME 45 to 49 does the same job. On X11 nothing extra is needed.

Not in the scripted checks yet

Sway and i3

Dozed reads the compositor's own IPC directly, so there is nothing extra to install.

Checked against headless Sway

Requirements
Linux with systemd and cgroup v2, which every current desktop distribution has. Building from source needs Rust 1.90 or newer.
Not in 0.1
  • Hyprland and niri are not supported yet.
  • Every measurement so far comes from one or two machines.
  • On Wayland, Dozed cannot see which app owns the clipboard.
  • Freezing does not free memory. That is not what Dozed is for.
Licence
Dozed is free and open source under the MIT licence. Source on GitHub
Help
Ask on Discord, report bugs on GitHub, or email [email protected]. Tell us what your machine does: a second and third set of hardware is what Dozed needs most.

Dozed is made by the team behind Zynk, which sends files straight between your devices. The name is borrowed from Android's Doze.