Closed Raffy23 closed 2 years ago
Thanks for pointing this out. I'm currently fixing some issues in a related project, which may take some time. Would you like to contribute, and submit a PR? Same about the second issue.
Sure, I can prepare PRs for these two issues.
Currently nwg-drawer uses a lot of cpu cycles for polling the USR1 signal and file change trigger variables at a high interval: https://github.com/nwg-piotr/nwg-drawer/blob/main/main.go#L494-L529. This can be avoided by using channels and a goroutine to only execute tasks in the event loop if necessary. For example, by changing
showWindowTrigger
into a channel and replacing the linked function with the following goroutine, the cpu utilization drops to 0 while not affecting the responsiveness.