forked from Shinonome/dots-hyprland
bar: fix multimonitor (?)
This commit is contained in:
@@ -56,6 +56,8 @@ const Windows = () => [
|
|||||||
forMonitors((id) => Corner(id, 'top right')),
|
forMonitors((id) => Corner(id, 'top right')),
|
||||||
forMonitors((id) => Corner(id, 'bottom left')),
|
forMonitors((id) => Corner(id, 'bottom left')),
|
||||||
forMonitors((id) => Corner(id, 'bottom right')),
|
forMonitors((id) => Corner(id, 'bottom right')),
|
||||||
|
forMonitors(BarCornerTopleft),
|
||||||
|
forMonitors(BarCornerTopright),
|
||||||
];
|
];
|
||||||
const CLOSE_ANIM_TIME = 210; // Longer than actual anim time to make sure widgets animate fully
|
const CLOSE_ANIM_TIME = 210; // Longer than actual anim time to make sure widgets animate fully
|
||||||
App.config({
|
App.config({
|
||||||
@@ -70,9 +72,6 @@ App.config({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Stuff that don't need to be toggled. And they're async so ugh...
|
// Stuff that don't need to be toggled. And they're async so ugh...
|
||||||
Bar().catch(print); // Use this to debug the bar. Single monitor only.
|
forMonitors(Bar);
|
||||||
// BarCornerTopleft().catch(print); // Use this to debug the bar. Single monitor only.
|
// Bar().catch(print); // Use this to debug the bar. Single monitor only.
|
||||||
// BarCornerTopright().catch(print); // Use this to debug the bar. Single monitor only.
|
|
||||||
// forMonitors(Bar);
|
|
||||||
forMonitors(BarCornerTopleft);
|
|
||||||
forMonitors(BarCornerTopright);
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ export const Bar = async (monitor = 0) => {
|
|||||||
const minHeight = styleContext.get_property('min-height', Gtk.StateFlags.NORMAL);
|
const minHeight = styleContext.get_property('min-height', Gtk.StateFlags.NORMAL);
|
||||||
// execAsync(['bash', '-c', `hyprctl keyword monitor ,addreserved,${minHeight},0,0,0`]).catch(print);
|
// execAsync(['bash', '-c', `hyprctl keyword monitor ,addreserved,${minHeight},0,0,0`]).catch(print);
|
||||||
},
|
},
|
||||||
startWidget: WindowTitle(),
|
startWidget: (await WindowTitle()),
|
||||||
centerWidget: Widget.Box({
|
centerWidget: Widget.Box({
|
||||||
className: 'spacing-h-4',
|
className: 'spacing-h-4',
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -38,39 +38,41 @@ const WindowTitle = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const OptionalWindowTitleInstance = await WindowTitle();
|
|
||||||
|
|
||||||
export default () => Widget.EventBox({
|
export default async () => {
|
||||||
onScrollUp: () => {
|
const optionalWindowTitleInstance = await WindowTitle();
|
||||||
Indicator.popup(1); // Since the brightness and speaker are both on the same window
|
return Widget.EventBox({
|
||||||
Brightness.screen_value += 0.05;
|
onScrollUp: () => {
|
||||||
},
|
Indicator.popup(1); // Since the brightness and speaker are both on the same window
|
||||||
onScrollDown: () => {
|
Brightness.screen_value += 0.05;
|
||||||
Indicator.popup(1); // Since the brightness and speaker are both on the same window
|
},
|
||||||
Brightness.screen_value -= 0.05;
|
onScrollDown: () => {
|
||||||
},
|
Indicator.popup(1); // Since the brightness and speaker are both on the same window
|
||||||
onPrimaryClick: () => {
|
Brightness.screen_value -= 0.05;
|
||||||
App.toggleWindow('sideleft');
|
},
|
||||||
},
|
onPrimaryClick: () => {
|
||||||
child: Widget.Box({
|
App.toggleWindow('sideleft');
|
||||||
homogeneous: false,
|
},
|
||||||
children: [
|
child: Widget.Box({
|
||||||
Widget.Box({ className: 'bar-corner-spacing' }),
|
homogeneous: false,
|
||||||
Widget.Overlay({
|
children: [
|
||||||
overlays: [
|
Widget.Box({ className: 'bar-corner-spacing' }),
|
||||||
Widget.Box({ hexpand: true }),
|
Widget.Overlay({
|
||||||
Widget.Box({
|
overlays: [
|
||||||
className: 'bar-sidemodule', hexpand: true,
|
Widget.Box({ hexpand: true }),
|
||||||
children: [Widget.Box({
|
Widget.Box({
|
||||||
vertical: true,
|
className: 'bar-sidemodule', hexpand: true,
|
||||||
className: 'bar-space-button',
|
children: [Widget.Box({
|
||||||
children: [
|
vertical: true,
|
||||||
OptionalWindowTitleInstance,
|
className: 'bar-space-button',
|
||||||
]
|
children: [
|
||||||
})]
|
optionalWindowTitleInstance,
|
||||||
}),
|
]
|
||||||
]
|
})]
|
||||||
})
|
}),
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
});
|
]
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -9,27 +9,28 @@ import Indicator from '../../../services/indicator.js';
|
|||||||
import { StatusIcons } from '../../.commonwidgets/statusicons.js';
|
import { StatusIcons } from '../../.commonwidgets/statusicons.js';
|
||||||
import { Tray } from "./tray.js";
|
import { Tray } from "./tray.js";
|
||||||
|
|
||||||
|
const SeparatorDot = () => Widget.Revealer({
|
||||||
|
transition: 'slide_left',
|
||||||
|
revealChild: false,
|
||||||
|
attribute: {
|
||||||
|
'count': SystemTray.items.length,
|
||||||
|
'update': (self, diff) => {
|
||||||
|
self.attribute.count += diff;
|
||||||
|
self.revealChild = (self.attribute.count > 0);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Widget.Box({
|
||||||
|
vpack: 'center',
|
||||||
|
className: 'separator-circle',
|
||||||
|
}),
|
||||||
|
setup: (self) => self
|
||||||
|
.hook(SystemTray, (self) => self.attribute.update(self, 1), 'added')
|
||||||
|
.hook(SystemTray, (self) => self.attribute.update(self, -1), 'removed')
|
||||||
|
,
|
||||||
|
});
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const barTray = Tray();
|
const barTray = Tray();
|
||||||
const separatorDot = Widget.Revealer({
|
|
||||||
transition: 'slide_left',
|
|
||||||
revealChild: false,
|
|
||||||
attribute: {
|
|
||||||
'count': SystemTray.items.length,
|
|
||||||
'update': (self, diff) => {
|
|
||||||
self.attribute.count += diff;
|
|
||||||
self.revealChild = (self.attribute.count > 0);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: Widget.Box({
|
|
||||||
vpack: 'center',
|
|
||||||
className: 'separator-circle',
|
|
||||||
}),
|
|
||||||
setup: (self) => self
|
|
||||||
.hook(SystemTray, (self) => self.attribute.update(self, 1), 'added')
|
|
||||||
.hook(SystemTray, (self) => self.attribute.update(self, -1), 'removed')
|
|
||||||
,
|
|
||||||
});
|
|
||||||
const barStatusIcons = StatusIcons({
|
const barStatusIcons = StatusIcons({
|
||||||
className: 'bar-statusicons',
|
className: 'bar-statusicons',
|
||||||
setup: (self) => self.hook(App, (self, currentName, visible) => {
|
setup: (self) => self.hook(App, (self, currentName, visible) => {
|
||||||
@@ -53,7 +54,7 @@ export default () => {
|
|||||||
const emptyArea = SpaceRightDefaultClicks(Widget.Box({ hexpand: true, }));
|
const emptyArea = SpaceRightDefaultClicks(Widget.Box({ hexpand: true, }));
|
||||||
const indicatorArea = SpaceRightDefaultClicks(Widget.Box({
|
const indicatorArea = SpaceRightDefaultClicks(Widget.Box({
|
||||||
children: [
|
children: [
|
||||||
separatorDot,
|
SeparatorDot(),
|
||||||
barStatusIcons
|
barStatusIcons
|
||||||
],
|
],
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user