This commit is contained in:
sankalp committed 2024-05-18 15:14:03 +05:45
1 parent 872683b11b
commit e1988a3962
119 files changed
+5679 -1811

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
const network = await Service.import("network");
const bluetooth = await Service.import("bluetooth");
import { isVertical } from "../../functions/utils.js";
import { configs } from "../../vars.js";
import PanelButton from "../PanelButton.js";
import { WINDOW_NAME } from "./Window.js";
const WifiIndicator = () =>
Widget.Icon().hook(network, (self) => {
const icon = network[network.primary || "wifi"]?.icon_name;
self.icon = icon || "";
self.visible = !!icon;
});
const BluetoothIndicator = () =>
Widget.Icon("bluetooth-active-symbolic").hook(bluetooth, (self) => {
self.visible = bluetooth.enabled;
});
export default () =>
PanelButton({
window: WINDOW_NAME,
child: Widget.Box({
spacing: 4,
vertical: configs.theme.bar.position.bind().as(isVertical),
children: [WifiIndicator(), BluetoothIndicator()],
}),
on_clicked: () => {
App.toggleWindow(WINDOW_NAME);
},
});