mirror of
https://github.com/danbulant/dots-hyprland
synced 2026-05-24 12:22:09 +00:00
fix the issue with the keyboard layout indicator not showing up on all monitors.
This commit is contained in:
parent
95c31b5692
commit
01dab4fdfc
3 changed files with 15 additions and 6 deletions
|
|
@ -277,15 +277,24 @@ const OptionalKeyboardLayout = async () => {
|
|||
return null;
|
||||
}
|
||||
};
|
||||
const optionalKeyboardLayoutInstance = await OptionalKeyboardLayout();
|
||||
const createKeyboardLayoutInstances = async () => {
|
||||
const Hyprland = (await import('resource:///com/github/Aylur/ags/service/hyprland.js')).default;
|
||||
const monitorsCount = Hyprland.monitors.length
|
||||
const instances = await Promise.all(
|
||||
Array.from({ length: monitorsCount }, () => OptionalKeyboardLayout())
|
||||
);
|
||||
|
||||
export const StatusIcons = (props = {}) => Widget.Box({
|
||||
return instances;
|
||||
};
|
||||
const optionalKeyboardLayoutInstances = await createKeyboardLayoutInstances()
|
||||
|
||||
export const StatusIcons = (props = {}, monitor = 0) => Widget.Box({
|
||||
...props,
|
||||
child: Widget.Box({
|
||||
className: 'spacing-h-15',
|
||||
children: [
|
||||
MicMuteIndicator(),
|
||||
optionalKeyboardLayoutInstance,
|
||||
optionalKeyboardLayoutInstances[monitor],
|
||||
NotificationIndicator(),
|
||||
NetworkIndicator(),
|
||||
Widget.Box({
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ export const Bar = async (monitor = 0) => {
|
|||
SideModule([System()]),
|
||||
]
|
||||
}),
|
||||
endWidget: Indicators(),
|
||||
endWidget: Indicators(monitor),
|
||||
});
|
||||
const focusedBarContent = Widget.CenterBox({
|
||||
className: 'bar-bg-focus',
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ const SeparatorDot = () => Widget.Revealer({
|
|||
,
|
||||
});
|
||||
|
||||
export default () => {
|
||||
export default (monitor = 0) => {
|
||||
const barTray = Tray();
|
||||
const barStatusIcons = StatusIcons({
|
||||
className: 'bar-statusicons',
|
||||
|
|
@ -38,7 +38,7 @@ export default () => {
|
|||
self.toggleClassName('bar-statusicons-active', visible);
|
||||
}
|
||||
}),
|
||||
});
|
||||
}, monitor);
|
||||
const SpaceRightDefaultClicks = (child) => Widget.EventBox({
|
||||
onHover: () => { barStatusIcons.toggleClassName('bar-statusicons-hover', true) },
|
||||
onHoverLost: () => { barStatusIcons.toggleClassName('bar-statusicons-hover', false) },
|
||||
|
|
|
|||
Loading…
Reference in a new issue