Added media, menu, network and power modules to bar.
This commit is contained in:
32
modules/bar/network/index.js
Normal file
32
modules/bar/network/index.js
Normal file
@@ -0,0 +1,32 @@
|
||||
const network = await Service.import("network");
|
||||
|
||||
const Network = () => {
|
||||
const wifiIndicator = [
|
||||
Widget.Icon({
|
||||
icon: network.wifi.bind("icon_name"),
|
||||
}),
|
||||
Widget.Label({
|
||||
label: network.wifi
|
||||
.bind("ssid")
|
||||
.as((ssid) => (ssid ? ` ${ssid}` : " Unknown")),
|
||||
}),
|
||||
];
|
||||
|
||||
const wiredIndicator = [
|
||||
Widget.Label({
|
||||
label: network.bind("wired").as(() => " Wired"),
|
||||
}),
|
||||
];
|
||||
|
||||
return {
|
||||
component: Widget.Box({
|
||||
class_name: "bar-network",
|
||||
children: network
|
||||
.bind("primary")
|
||||
.as((w) => (w === "wired" ? wiredIndicator : wifiIndicator)),
|
||||
}),
|
||||
isVisible: true,
|
||||
};
|
||||
};
|
||||
|
||||
export { Network };
|
||||
Reference in New Issue
Block a user