forked from Shinonome/dots-hyprland
format
This commit is contained in:
@@ -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,
|
||||
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user