Skip to content
vamola.devv2.4 · online

Finding a Battery Drain by Measuring: a Desktop Visualizer That Cost 3 W

Last Updated: 2026-11-25·Reading Time: 4 min·Linux / Power

A laptop (ASUS ROG Zephyrus G14, Ryzen 9, Arch Linux, Hyprland with a Quickshell desktop shell) drew 30 to 45 W on battery while "doing nothing much". The usual advice is a list of settings to change. This page is what happened when I measured instead of guessing, including the settings that turned out to change nothing.

One laptop, one shell

Everything below was measured on one machine with one shell configuration. Your numbers will differ. The method is the useful part.


1. One measurement tells you nothing

The battery reports current and voltage, so the draw in watts is their product:

Terminal (bash)
# battery draw in watts, right now
awk -v c="$(cat /sys/class/power_supply/BAT1/current_now)" \
  -v u="$(cat /sys/class/power_supply/BAT1/voltage_now)" \
  'BEGIN{printf "%.1f W\n", c*u/1e12}'

The first surprise was that the same setting measured 36 W, then 30 W a few minutes later. At true idle the machine drew 16 to 17 W; while in use it swung between 30 and 45 W. What you do changes the number far more than most settings, so a single before/after pair proves nothing.

The fix is to alternate: setting A, setting B, A, B, several rounds, about 15 seconds each, averaging a sample every second. Drift and your own activity then land on both sides of the comparison. Always restore the setting afterwards.


Each was measured in alternating rounds on battery:

TweakWhat the rounds showed
120 Hz to 60 Hz18.8 vs 17.4 W, 16.2 vs 16.9 W, 23.0 vs 30.2 W. No consistent winner; the last round was my own activity
Window blur on or offGPU busy ranged from 8% to 65% across rounds with no pattern tied to blur; battery within the noise
Brightness 80% to 50%32 to 45 W across rounds with no consistent difference; it followed what was on screen

That does not mean these settings never matter, only that on this panel and this workload they were not the lever. Without alternating rounds I would have "found" a 6 W win in any one of them.


3. Who is using the GPU?

The integrated GPU was at 60 to 70% and 10 to 15 W. The kernel can tell you which program is responsible: every program that uses a GPU exposes its GPU time in /proc/PID/fdinfo (for your own programs, no root).

Terminal (bash)
# GPU time (nanoseconds) of every program that has the GPU open: sample twice and subtract
grep -H 'drm-engine' /proc/*/fdinfo/* 2>/dev/null | grep -v capacity | head

Sampled over 8 seconds, with a video playing in Firefox:

ProgramShare of the GPU
Hyprland (the compositor)25%
Firefox17%
Firefox's media decoder16%
Quickshell (the desktop shell)4%

So the GPU was busy with ordinary things: composing the screen and decoding a video. The shell was not the GPU's problem. It was a different problem.


4. The CPU number that misled

Quickshell used about 60% of one core while the GPU was fine. An early reading said 46%, with a quick explanation: "that is the average over its whole life, right now it is 10 to 25%". Both halves are worth checking:

Terminal (bash)
# per thread, right now (not the lifetime average that ps shows)
top -H -b -n 1 -p "$(pgrep -x qs)" | head -12

ps shows CPU time divided by the program's whole lifetime, so a program that was busy earlier looks busy now. Measured over a few seconds, Quickshell really was at about 60% of a core: roughly half in the main thread and a quarter in its render thread. That pattern, a render thread that never rests, means something keeps redrawing the screen.

My next guess was the music: audio was playing. I paused it and measured again: 58% playing, 63% paused. It was not the music.


5. Reading the shell's settings

The shell keeps its settings in a JSON file. Reading it (not changing it) showed one candidate worth testing: the desktop background audio visualizer was enabled, fed by cava at 60 frames per second. An audio visualizer that keeps drawing while nothing plays fits a render thread that never rests.


6. The experiment

Back up the file, flip one setting, measure, flip it back, repeat, as in section 1:

Terminal (bash)
cp -p ~/.config/illogical-impulse/config.json{,.backup}
# set  background.widgets.visualizer.enable  to false (the shell reloads it on its own)
# measure the shell's CPU and the battery, then set it back to true and measure again

Over several alternating rounds:

Visualizer onVisualizer off
Quickshell CPU45 to 52% of a core3 to 4%
GPU busy / power66 to 68%, 12 to 13 W23 to 26%, 5 to 7 W
Battery draw28.4 to 30.1 W25.6 to 26.8 W

The battery difference averaged about 2.8 W, close to 10% of the total, and the sign was the same in every round. It was the first change that survived alternating measurement.


What to take from it

  1. Alternate, repeat, restore. A, B, A, B beats any single before/after.
  2. Look at the GPU per program. fdinfo tells you who, without root, for your own programs.
  3. Compare "now" with "over its whole life". They can be far apart.
  4. Rule things out. Pausing the music was a five-second test that removed a whole theory.
  5. Change one thing, with a backup. And keep the setting only if the numbers say it helped.

Doing this with kerna

kerna automates the parts of this that are tedious:

Terminal (bash)
kerna why qs          # now vs its whole life, which thread, GPU, child programs
kerna watch           # press t: the busiest programs with their GPU share
kerna snapshot        # measure ... change one thing ...
kerna compare         # ... and see what got better or worse

kerna snapshot and kerna compare do one measurement per call, so for a fair answer repeat them in alternating rounds as above.