diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-03-26 20:51:19 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-03-26 20:51:19 +1100 |
| commit | 8772a05a903ba08d5ae1cd8b7e572a5eadbc009d (patch) | |
| tree | 7a32841aebce86e1b1b21a2aa04c6765df4cfec7 | |
| parent | sidebar: handle no wifi card (diff) | |
| download | caelestia-shell-8772a05a903ba08d5ae1cd8b7e572a5eadbc009d.tar.gz caelestia-shell-8772a05a903ba08d5ae1cd8b7e572a5eadbc009d.tar.bz2 caelestia-shell-8772a05a903ba08d5ae1cd8b7e572a5eadbc009d.zip | |
sidebar: show bluetooth device battery
| -rw-r--r-- | src/modules/sidebar/modules/bluetooth.tsx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/modules/sidebar/modules/bluetooth.tsx b/src/modules/sidebar/modules/bluetooth.tsx index c74a708..b6ff6d7 100644 --- a/src/modules/sidebar/modules/bluetooth.tsx +++ b/src/modules/sidebar/modules/bluetooth.tsx @@ -24,7 +24,9 @@ const BluetoothDevice = (device: AstalBluetooth.Device) => ( xalign={0} setup={self => { const update = () => { - self.label = device.connected ? "Connected" : "Paired"; + self.label = + (device.connected ? "Connected" : "Paired") + + (device.batteryPercentage !== -1 ? ` (${device.batteryPercentage * 100}%)` : ""); self.visible = device.connected || device.paired; }; self.hook(device, "notify::connected", update); |