ags
ags copied to clipboard
Restarting AGS breaks the system tray/systray
This is hard to reproduce since it doesn't always happen, but sometimes when I restart ags the systray doesn't ever launch again until I reboot the system. I can launch other system trays apps (like stalonetray for example), and it shows the app icons normally, but when I launch ags it just tells me Another system tray is already running, and refuses to run. This doesn't always happen, and I couldn't figure out what triggers it.
The systray module I use is the following:
function SysTray() {
const items = systemtray.bind("items").as((items) =>
[
Widget.Button({
className: "sys-tray-item tray-custom-icon",
on_primary_click: () => {
Utils.exec(`swaync-client --toggle-panel`)
},
on_secondary_click: () => {
Utils.exec(`swaync-client --toggle-dnd`)
},
label: "",
setup: self => self.hook(NotificationInfo, () => {
if (NotificationInfo.value === null) {
return;
} else if (NotificationInfo.value.inhibited || NotificationInfo.value.dnd) {
self.label = "";
} else {
self.label = "";
}
}),
}),
...items.map((item) =>
Widget.Button({
className: "sys-tray-item",
child: Widget.Icon({ icon: item.bind("icon") }),
on_primary_click: (_, event) => item.activate(event),
on_secondary_click: (_, event) => item.openMenu(event),
tooltip_markup: item.bind("tooltip_markup"),
}),
)
],
);
return Widget.Box({
children: items,
});
}
Nothing out of the ordinary IMO, but the full config is also available here. Is this a common problem? Any ideas how to debug this? ags -q doesn't help (ags is not running at all when this happens, until I of course launch it), and this only happens with AGS, and only when I restart it, so I assume either ags is not properly disposing of the tray sometimes, or the tray-detection of ags is broken (since I can still launch stalonetray, for example). The video attached shows the behaviour happening, and how I can still launch other systrays
https://github.com/user-attachments/assets/8a2f238d-0f46-4b0c-9e0f-bd6fa9a3020b
This is very annoying when I'm developing, since I'm constantly restarting ags (since ags doesn't have hot-reload builtin), and because of that, I also need to keep restarting my computer to see my changes, which is a terrible UX :sweat_smile:
I experience this issue too, although waybar has the same problem for me (tray launches on login once only), so i suspect the issue lies elsewhere, (not an ags/waybar problem).
btw you can just logout/kill your wm, you dont need to restart the machine. Let me know if you figure it out/solve it :)
Hi @Aylur, this unfortunately is still an issue for me and for others too, its one of the main reasons why I just left my AGS config as is and haven't further developed it... Is there a specific reason for it to have been closed as not planned? :/
https://github.com/Aylur/ags/pull/504
ahhh, got it, I'll check if on a v2 setup this still happens, thanks!