From 13032c8f03c621ec9bd189c0c5a5a77ccebf0a3b Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 18 Apr 2024 18:49:58 +0700 Subject: [PATCH] get active monitor id: use hyprland service --- .config/ags/modules/dock/dock.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.config/ags/modules/dock/dock.js b/.config/ags/modules/dock/dock.js index a7cb0ad6e..f2ae00342 100644 --- a/.config/ags/modules/dock/dock.js +++ b/.config/ags/modules/dock/dock.js @@ -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; }