home/natto/ags: init
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
19
home/natto/ags/windows/bar/bluetooth.js
Normal file
19
home/natto/ags/windows/bar/bluetooth.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const bluetooth = await Service.import("bluetooth");
|
||||
|
||||
export default () =>
|
||||
Widget.Icon({
|
||||
setup: (self) =>
|
||||
self.hook(
|
||||
bluetooth,
|
||||
(self) => {
|
||||
self.tooltipText = bluetooth.connected_devices
|
||||
.map(({ name }) => name)
|
||||
.join("\n");
|
||||
self.visible = bluetooth.connected_devices.length > 0;
|
||||
},
|
||||
"notify::connected-devices",
|
||||
),
|
||||
icon: bluetooth
|
||||
.bind("enabled")
|
||||
.as((on) => `bluetooth-${on ? "active" : "disabled"}-symbolic`),
|
||||
});
|
Reference in New Issue
Block a user