Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Power Overlay

Shows your device's realtime power draw in watts right in the GNOME top bar, embedded next to the battery icon:

 …  -13.2W  68%  🔋   …
    2h 14m left

This is a GNOME Shell extension (GNOME 45+ / GNOME 50). No hotkey needed — it's always visible next to the battery.

What it shows

  • A compact two-line label directly to the left of the battery icon:
    • Top: wattage with a +/- sign (charging / discharging) and the battery percentage, e.g. -13.2W 68%.
    • Bottom: live estimated time — 2h 14m left while discharging (screen time), or 1h 05m to full while charging. Both are calculated in real time from the current wattage only.
  • The wattage is the whole-device power draw (battery power_now), and the percentage is the battery charge.
  • The wattage is smoothed (EMA) so it doesn't flicker between samples.
  • If there is no battery reading (e.g. plugged in), it falls back to the CPU RAPL energy counter. If neither sensor is readable it shows —.

Where the number comes from

  1. Battery sensor (/sys/class/power_supply/BAT0/power_now) — whole-device draw straight from the battery, unprivileged on laptops. Also used for the percentage (BAT0/capacity).
  2. CPU RAPL (/sys/class/powercap/intel-rapl:0/energy_uj) — fallback while on AC. Note: recent kernels require root to read RAPL energy counters, so on some systems the CPU fallback reads Permission denied and the label shows — while on AC.
  3. Battery state (BAT0/status, BAT0/charge_now, BAT0/voltage_now) — decides the +/- sign and feeds the time estimate: remaining energy divided by the current draw for “time left”, (full − now) divided by the current draw for “time to full”.

Install

./install-extension.sh

This copies the extension to ~/.local/share/gnome-shell/extensions/poweroverlay@local/ and tries to enable it. If you're on a running GNOME session, restart isn't needed — just:

gnome-extensions enable poweroverlay@local

(You can also toggle it in Extensions / GNOME Tweaks.)

Uninstall

./uninstall-extension.sh

Layout details

The extension inserts its label immediately to the left of the battery indicator in the top bar's quick-settings row (quickSettings._indicators, before quickSettings._system). The battery percentage shown is independent of GNOME's own Show Battery Percentage setting, so it always appears.

Files

Path Purpose
extension/poweroverlay@local/metadata.json Extension metadata (uuid, supported Shell versions)
extension/poweroverlay@local/extension.js The indicator logic + panel placement
install-extension.sh Install + enable the extension
uninstall-extension.sh Disable + remove the extension

About

GNOME Shell extension: realtime device wattage + battery percentage next to the battery icon in the top bar

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages