get active monitor id: use hyprland service

This commit is contained in:
end-4
2024-04-18 18:49:58 +07:00
parent 5230e8cb54
commit 13032c8f03
+1 -7
View File
@@ -58,12 +58,6 @@ function ExclusiveWindow(client) {
const focus = ({ address }) => Utils.execAsync(`hyprctl dispatch focuswindow address:${address}`).catch(print);
const activeMonitorId = () => {
let monitors = JSON.parse(exec('hyprctl monitors -j'))
let activeMonitor = monitors.find((e) => e["focused"] === true)
return activeMonitor["id"]
}
const DockSeparator = (props = {}) => Box({
...props,
className: 'dock-separator',
@@ -306,7 +300,7 @@ export default (monitor = 0) => {
// // }
if (userOptions.dock.monitorExclusivity) {
self.revealChild = activeMonitorId() === monitor
self.revealChild = Hyprland.active.monitor.id === monitor
} else {
self.revealChild = true;
}