mirror of
https://github.com/danbulant/dots-hyprland
synced 2026-05-24 12:22:09 +00:00
status icons: add 'wifi disconnected' and 'bluetooth connected' icons (#935)
This commit is contained in:
commit
b025bd2cac
1 changed files with 22 additions and 12 deletions
|
|
@ -86,14 +86,20 @@ export const BluetoothIndicator = () => Widget.Stack({
|
||||||
transition: 'slide_up_down',
|
transition: 'slide_up_down',
|
||||||
transitionDuration: userOptions.animations.durationSmall,
|
transitionDuration: userOptions.animations.durationSmall,
|
||||||
children: {
|
children: {
|
||||||
'false': Widget.Label({ className: 'txt-norm icon-material', label: 'bluetooth_disabled' }),
|
'disabled': Widget.Label({ className: 'txt-norm icon-material', label: 'bluetooth_disabled' }),
|
||||||
'true': Widget.Label({ className: 'txt-norm icon-material', label: 'bluetooth' }),
|
'enabled': Widget.Label({ className: 'txt-norm icon-material', label: 'bluetooth' }),
|
||||||
|
'connected': Widget.Label({ className: 'txt-norm icon-material', label: 'bluetooth_connected' }),
|
||||||
},
|
},
|
||||||
setup: (self) => self
|
setup: (self) =>
|
||||||
.hook(Bluetooth, stack => {
|
self.hook(Bluetooth, (stack) => {
|
||||||
stack.shown = String(Bluetooth.enabled);
|
if (!Bluetooth.enabled) {
|
||||||
})
|
stack.shown = 'disabled';
|
||||||
,
|
} else if (Bluetooth.connected_devices.length === 0) {
|
||||||
|
stack.shown = 'enabled';
|
||||||
|
} else if (Bluetooth.connected_devices.length > 0) {
|
||||||
|
stack.shown = 'connected';
|
||||||
|
}
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
const BluetoothDevices = () => Widget.Box({
|
const BluetoothDevices = () => Widget.Box({
|
||||||
|
|
@ -158,8 +164,11 @@ const NetworkWifiIndicator = () => Widget.Stack({
|
||||||
transition: 'slide_up_down',
|
transition: 'slide_up_down',
|
||||||
transitionDuration: userOptions.animations.durationSmall,
|
transitionDuration: userOptions.animations.durationSmall,
|
||||||
children: {
|
children: {
|
||||||
'disabled': Widget.Label({ className: 'txt-norm icon-material', label: 'wifi_off' }),
|
'disabled': Widget.Label({ className: 'txt-norm icon-material', label: 'signal_wifi_off' }),
|
||||||
'disconnected': Widget.Label({ className: 'txt-norm icon-material', label: 'signal_wifi_off' }),
|
'disconnected': Widget.Label({
|
||||||
|
className: 'txt-norm icon-material',
|
||||||
|
label: 'signal_wifi_statusbar_not_connected',
|
||||||
|
}),
|
||||||
'connecting': Widget.Label({ className: 'txt-norm icon-material', label: 'settings_ethernet' }),
|
'connecting': Widget.Label({ className: 'txt-norm icon-material', label: 'settings_ethernet' }),
|
||||||
'0': Widget.Label({ className: 'txt-norm icon-material', label: 'signal_wifi_0_bar' }),
|
'0': Widget.Label({ className: 'txt-norm icon-material', label: 'signal_wifi_0_bar' }),
|
||||||
'1': Widget.Label({ className: 'txt-norm icon-material', label: 'network_wifi_1_bar' }),
|
'1': Widget.Label({ className: 'txt-norm icon-material', label: 'network_wifi_1_bar' }),
|
||||||
|
|
@ -171,10 +180,11 @@ const NetworkWifiIndicator = () => Widget.Stack({
|
||||||
if (!Network.wifi) {
|
if (!Network.wifi) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Network.wifi.internet == 'connected') {
|
if (!Network.wifi.enabled) {
|
||||||
|
stack.shown = 'disabled';
|
||||||
|
} else if (Network.wifi.internet == 'connected') {
|
||||||
stack.shown = String(Math.ceil(Network.wifi.strength / 25));
|
stack.shown = String(Math.ceil(Network.wifi.strength / 25));
|
||||||
}
|
} else if (['disconnected', 'connecting'].includes(Network.wifi.internet)) {
|
||||||
else if (["disconnected", "connecting"].includes(Network.wifi.internet)) {
|
|
||||||
stack.shown = Network.wifi.internet;
|
stack.shown = Network.wifi.internet;
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue