From f84abf9908e47bfc14590fd6f3ca9ee106fc9751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Tue, 8 Oct 2024 11:27:25 +0200 Subject: [PATCH] Always use monitor with the lowest id for ags --- home/ags/files/config.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/home/ags/files/config.js b/home/ags/files/config.js index e622c74..041966b 100644 --- a/home/ags/files/config.js +++ b/home/ags/files/config.js @@ -49,6 +49,13 @@ const volumeIndicator = Widget.Button({ ]}), }); +let monitor = 0 +for (const mon in hyprland.monitors) { + if (hyprland.monitors[mon]["id"] < hyprland.monitors[monitor]["id"]) { + monitor = mon + } +} + function Clients() { const activeId = hyprland.active.client.bind("address") const clients = hyprland.bind("clients").as(cl => @@ -106,7 +113,6 @@ function Workspaces() { function SysTray() { const items = systemtray.bind("items") .as(items => items.map(item => { - print(JSON.stringify(item)) return Widget.Button({ child: Widget.Icon({ icon: item.bind("icon"), @@ -256,11 +262,12 @@ function Bar(monitor = 0) { }) } +print(JSON.stringify(monitor)) App.config({ style: "./style.css", iconTheme: "Papirus", windows: [ - Bar(0), + Bar(monitor), NotificationPopups(), ], })