-
|
Are there any plans to support system trayMenu? I find xbar can set trayMenu, it's wails version is But the last wails version |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
|
Tray support is planned for a post v2 release, IIRC for v2.1 |
Beta Was this translation helpful? Give feedback.
-
|
Currently, wails does not support the tray menu, and both the systray library and wails use the main thread, so it is difficult to use them together. so, I made a small program that uses the systray library. I also created a client library that can be controlled via IPC. The library automatically installs the remote control tray application in the temporary folder, and after running it, set up IPC communication. func RunTray(){
tray, err := remotray.Run("<unix-domain-socket | pipe name for IPC>",
remotray.WithTitle("TITLE"),)
if err != nil {
panic(err)
}
item, _ := tray.AddMenuItem("item title.1", "Tooltop")
item.OnClick(func(item MenuItem) {
fmt.Println("onclick", item)
})
item, _ = tray.AddMenuItem("quit", "Tooltop")
item.OnClick(func(item MenuItem) {
tray.Quit()
})
}finally, I was able to control the tray menu while using the wails library. https://github.com/Ironpark/remotray |
Beta Was this translation helpful? Give feedback.

@daodao97 @stffabi
Currently, wails does not support the tray menu, and both the systray library and wails use the main thread, so it is difficult to use them together.
so, I made a small program that uses the systray library. I also created a client library that can be controlled via IPC.
The library automatically installs the remote control tray application in the temporary folder, and after running it, set up IPC communication.