Monitor identification update. (#107)

* Add proper gtk to hyprland monitor mapping

* Updated the monitor identification logic to sync GDK monitor IDs properly with hyprland monitor IDs.

* Remove console statement.

* Revert this to how it was before since its exactly the same thing.
This commit is contained in:
Jas Singh
2024-08-10 18:34:55 -07:00
committed by GitHub
parent f3d287ad59
commit 0898c98f9c
3 changed files with 205 additions and 59 deletions

View File

@@ -54,8 +54,8 @@ export async function sh(cmd: string | string[]) {
}
export function forMonitors(widget: (monitor: number) => Gtk.Window) {
const n = Gdk.Display.get_default()?.get_n_monitors() || 1
return range(n, 0).flatMap(widget)
const n = Gdk.Display.get_default()?.get_n_monitors() || 1;
return range(n, 0).flatMap(widget);
}
/**
@@ -148,7 +148,7 @@ export const Notify = (notifPayload: NotificationArgs): void => {
Utils.execAsync(command)
}
export function getPosition (pos: NotificationAnchor | OSDAnchor): ("top" | "bottom" | "left" | "right")[] {
export function getPosition(pos: NotificationAnchor | OSDAnchor): ("top" | "bottom" | "left" | "right")[] {
const positionMap: { [key: string]: ("top" | "bottom" | "left" | "right")[] } = {
"top": ["top"],
"top right": ["top", "right"],
@@ -161,4 +161,4 @@ export function getPosition (pos: NotificationAnchor | OSDAnchor): ("top" | "bot
};
return positionMap[pos] || ["top"];
}
}