fix screen size for multimonitor and scaled screens (#417) (#424)

This commit is contained in:
end-4
2024-04-25 15:20:15 +07:00
parent 394cd0fc0a
commit 18de9e2fea
7 changed files with 44 additions and 73 deletions
@@ -0,0 +1,17 @@
const { GLib } = imports.gi;
import Variable from 'resource:///com/github/Aylur/ags/variable.js';
import * as Utils from 'resource:///com/github/Aylur/ags/utils.js';
const { execAsync, exec } = Utils;
export let monitors;
// ughh condition race theoretically but overview won't be open at init so i guess it's okay
async function updateStuff() {
monitors = JSON.parse(exec('hyprctl monitors -j'))
monitors.forEach(monitor => {
monitor.width /= monitor.scale;
monitor.height /= monitor.scale;
});
}
updateStuff();