fix wrong monitor size (#537)

This commit is contained in:
end-4
2024-05-25 19:50:13 +07:00
parent df9adb18da
commit 3f18c4bc9d
5 changed files with 11 additions and 6 deletions
@@ -1,19 +0,0 @@
const { Gdk } = imports.gi;
import * as Utils from 'resource:///com/github/Aylur/ags/utils.js';
const { execAsync, exec } = Utils;
export let monitors;
// Mixes with Gdk monitor size cuz it reports monitor size scaled
async function updateStuff() {
monitors = JSON.parse(exec('hyprctl monitors -j'))
const display = Gdk.Display.get_default();
monitors.forEach((monitor, i) => {
const gdkMonitor = display.get_monitor(i);
monitor.width = gdkMonitor.get_geometry().width;
monitor.height = gdkMonitor.get_geometry().height;
});
}
updateStuff().catch(print);