aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/bluetooth/README.md
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-20 11:45:08 +0200
committerDanilo M. <danix@danix.xyz>2026-09-20 11:45:08 +0200
commit59c4a841b7107f6b21bcd1c8f120c8caf1bd2d7c (patch)
tree868891e386c2e7597a3364aaed8c752c7a245469 /desktop/modules/bluetooth/README.md
parenteba0c13ad2f50964b6f88950366cb659c0d8b055 (diff)
downloadquickshell-59c4a841b7107f6b21bcd1c8f120c8caf1bd2d7c.tar.gz
quickshell-59c4a841b7107f6b21bcd1c8f120c8caf1bd2d7c.zip
feat(desktop): read gamepad battery from power_supply
BluetoothRow only read BluetoothDevice.battery, which is BlueZ's org.bluez.Battery1. A gamepad never publishes that interface: a Sony pad exposes its charge as a kernel power_supply instead, so the percentage never appeared. Read every power_supply whose name ends in a MAC on a 30s timer while anything is connected, keyed by address. BlueZ still wins when it has a value.
Diffstat (limited to 'desktop/modules/bluetooth/README.md')
-rw-r--r--desktop/modules/bluetooth/README.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/desktop/modules/bluetooth/README.md b/desktop/modules/bluetooth/README.md
index 2de634a..5a79060 100644
--- a/desktop/modules/bluetooth/README.md
+++ b/desktop/modules/bluetooth/README.md
@@ -10,6 +10,22 @@ then the connected devices, the paired ones, and anything found while
scanning. A paired device offers Connect, Trust and Forget; an unpaired one
offers Pair.
+## Battery has two sources
+
+The row shows a percentage when it can find one, from either of two places:
+
+- `BluetoothDevice.battery` / `batteryAvailable`, which is BlueZ's
+ `org.bluez.Battery1`. Audio devices push this live. Nothing to poll.
+- A kernel `power_supply`, read by the module on a 30s timer while anything is
+ connected. Gamepads are the reason: a Sony pad publishes no `Battery1`, it
+ exposes the charge as `/sys/class/power_supply/ps-controller-battery-<mac>`
+ (DualSense) or `sony_controller_battery_<mac>` (DS4). The module reads every
+ supply whose name ends in a MAC and keys it by the address, so the driver
+ and its separator do not matter.
+
+BlueZ wins when both exist. Neither source knowing the device leaves the field
+empty, never a zero.
+
## Pairing is the one shell-out
Quickshell ships no BlueZ pairing agent and no generic D-Bus module, so a