Use wmctrl for better detection of WM

This adds the optional dependency wmctrl to the project. If the file does not exist, it simply falls back to the old way of detecting the window manager.