This commit is contained in:
end-4
2025-02-12 10:27:56 +01:00
parent 236e45a1e4
commit 230b402a9a
@@ -59,24 +59,24 @@ const WifiNetwork = (accessPoint) => {
const NetResource = (icon, command) => {
const resourceLabel = Label({
className: `txt-smaller txt-subtext`,
});
const widget = Button({
child: Box({
hpack: 'start',
className: `spacing-h-4`,
children: [
MaterialIcon(icon, 'very-small'),
resourceLabel,
],
setup: (self) => self.poll(2000, () => execAsync(['bash', '-c', command])
.then((output) => {
resourceLabel.label = output;
}).catch(print))
,
})
});
return widget;
className: `txt-smaller txt-subtext`,
});
const widget = Button({
child: Box({
hpack: 'start',
className: `spacing-h-4`,
children: [
MaterialIcon(icon, 'very-small'),
resourceLabel,
],
setup: (self) => self.poll(2000, () => execAsync(['bash', '-c', command])
.then((output) => {
resourceLabel.label = output;
}).catch(print))
,
})
});
return widget;
}
const CurrentNetwork = () => {
@@ -109,10 +109,10 @@ const CurrentNetwork = () => {
hexpand: true,
hpack: 'center',
className: 'sidebar-wifinetworks-bandwidth',
children: [
NetResource('arrow_warm_up' , `${App.configDir}/scripts/network_scripts/network_bandwidth.py sent`),
NetResource('arrow_cool_down', `${App.configDir}/scripts/network_scripts/network_bandwidth.py recv`),
]
children: [
NetResource('arrow_warm_up', `${App.configDir}/scripts/network_scripts/network_bandwidth.py sent`),
NetResource('arrow_cool_down', `${App.configDir}/scripts/network_scripts/network_bandwidth.py recv`),
]
});
const networkStatus = Box({
children: [Label({
@@ -169,7 +169,7 @@ const CurrentNetwork = () => {
children: [
MaterialIcon('language', 'hugerass'),
networkName,
networkBandwidth,
networkBandwidth,
networkStatus,
]