summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-03-26 20:51:19 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-03-26 20:51:19 +1100
commit8772a05a903ba08d5ae1cd8b7e572a5eadbc009d (patch)
tree7a32841aebce86e1b1b21a2aa04c6765df4cfec7 /src
parentsidebar: handle no wifi card (diff)
downloadcaelestia-shell-8772a05a903ba08d5ae1cd8b7e572a5eadbc009d.tar.gz
caelestia-shell-8772a05a903ba08d5ae1cd8b7e572a5eadbc009d.tar.bz2
caelestia-shell-8772a05a903ba08d5ae1cd8b7e572a5eadbc009d.zip
sidebar: show bluetooth device battery
Diffstat (limited to 'src')
-rw-r--r--src/modules/sidebar/modules/bluetooth.tsx4
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);