Instead of using KX11Extras, use taskmanager to find amount of windows per activity. This also makes it work on Wayland.