Replies: 2 comments
-
Found this relative issue #363 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Answer to myself : config.js for (const monitor of hyprland.monitors) {
// I give Hyprland Monitor object to my Bar
App.addWindow(Bar(monitor));
} Bar.js function Bar(monitor) {
// Do whatever you want with Hyprland monitor.id, condition visibility ...
return Widget.Window({
name: `bar-${monitor.id}`,
// convert Hyprland monitor ID to GDK monitor ID
monitor: getGdkMonitorFromHyprlandId(monitor.id),
...
});
} utils.js const Hyprland = await Service.import('hyprland');
export function getGdkMonitorFromHyprlandId(id) {
const m = Hyprland.monitors.find((m) => m.id === id);
if (!m) {
return 0;
}
let monitor = Gdk.Display.get_default()?.get_monitor_at_point(m.x + 1, m.y + 1);
for (let i = 0; i < Gdk.Display.get_default()?.get_n_monitors(); i++) {
if (Gdk.Display.get_default()?.get_monitor(i) === monitor) {
return i;
}
}
return 0;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
I'm using a multi screens setup with Hyprland, and I would like to display only the workspace indicators of the screen on which my Bar instance is displayed.
Say otherwise, do not display all workspaces on all bars, only workspaces of the bar screen.
The issue is that the Window widget
monitor
value do not match the Hyprland monitorID. And I don't know how to filter workspaces without maintaining a mapping of the two id list.Do you have a clue to this problem?
Beta Was this translation helpful? Give feedback.
All reactions