Only this component, without the full session. First add the Swaydesk repository, as on the page Install.
Debian 13
sudo apt install swaydesk-battery
Ubuntu 26.04 · Mint 27
sudo apt install swaydesk-battery
Arch Linux
sudo pacman -Syu swaydesk-battery upower
pacman doesn't install optional dependencies, so the line already has the ones apt installs by itself.
Start it on plain Sway
It starts from its Waybar module, below.
In Waybar
In ~/.config/waybar/config.jsonc, add "custom/swaydesk-battery" to modules-left, modules-center or modules-right, and paste the module from this file next to your other modules:
/usr/share/swaydesk/waybar/swaydesk-battery.jsonc
The file's first lines say what each click does. The icons come from the Symbols Nerd Font, which the package brings.
Shortcuts
Click the battery
Those of the Swaydesk profile, the default. The other profiles are in Shortcuts.