bar: add "nothing" mode (#544)

This commit is contained in:
end-4
2024-06-08 20:20:50 +07:00
parent acd6154a75
commit 8752384306
3 changed files with 17 additions and 3 deletions
+6 -1
View File
@@ -77,11 +77,14 @@ export const Bar = async (monitor = 0) => {
endWidget: Widget.Box({}),
setup: (self) => {
self.hook(Battery, (self) => {
if(!Battery.available) return;
if (!Battery.available) return;
self.toggleClassName('bar-bg-focus-batterylow', Battery.percent <= userOptions.battery.low);
})
}
});
const nothingContent = Widget.Box({
className: 'bar-bg-nothing',
})
return Widget.Window({
monitor,
name: `bar${monitor}`,
@@ -95,9 +98,11 @@ export const Bar = async (monitor = 0) => {
children: {
'normal': normalBarContent,
'focus': focusedBarContent,
'nothing': nothingContent,
},
setup: (self) => self.hook(currentShellMode, (self) => {
self.shown = currentShellMode.value;
})
}),
});