Added more configuration options

This commit is contained in:
Jas Singh
2024-07-20 16:21:52 -07:00
parent 29abe55008
commit a480400359
37 changed files with 368 additions and 417 deletions

View File

@@ -21,41 +21,43 @@ const Ethernet = () => {
child: Widget.Box({
class_name: "menu-content",
vertical: true,
child: network.bind("wired").as((wired) => {
return Widget.Box({
class_name: "network-element-item",
child: Widget.Box({
hpack: "start",
children: [
Widget.Icon({
class_name: `network-icon ethernet ${network.wired.state === "activated" ? "active" : ""}`,
tooltip_text: wired.internet,
icon: `${wired["icon_name"]}`,
}),
Widget.Box({
class_name: "connection-container",
vertical: true,
children: [
Widget.Label({
class_name: "active-connection",
hpack: "start",
truncate: "end",
wrap: true,
label: `Ethernet Connection ${wired.state !== "unknown" && typeof wired?.speed === "number" ? `(${wired?.speed / 1000} Gbps)` : ""}`,
}),
Widget.Label({
hpack: "start",
class_name: "connection-status dim",
label:
wired.internet.charAt(0).toUpperCase() +
wired.internet.slice(1),
}),
],
}),
],
}),
setup: (self) => {
self.hook(network, () => {
return (self.child = Widget.Box({
class_name: "network-element-item",
child: Widget.Box({
hpack: "start",
children: [
Widget.Icon({
class_name: `network-icon ethernet ${network.wired.state === "activated" ? "active" : ""}`,
tooltip_text: network.wired.internet,
icon: `${network.wired["icon_name"]}`,
}),
Widget.Box({
class_name: "connection-container",
vertical: true,
children: [
Widget.Label({
class_name: "active-connection",
hpack: "start",
truncate: "end",
wrap: true,
label: `Ethernet Connection ${network.wired.state !== "unknown" && typeof network.wired?.speed === "number" ? `(${network.wired?.speed / 1000} Gbps)` : ""}`,
}),
Widget.Label({
hpack: "start",
class_name: "connection-status dim",
label:
network.wired.internet.charAt(0).toUpperCase() +
network.wired.internet.slice(1),
}),
],
}),
],
}),
}));
});
}),
},
}),
}),
],

View File

@@ -7,7 +7,7 @@ export default () => {
name: "networkmenu",
transition: "crossfade",
child: Widget.Box({
class_name: "menu-items",
class_name: "menu-items network",
child: Widget.Box({
vertical: true,
hexpand: true,