Release X11 Window Control pack - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27) +---- Forum: Service Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=152) +---- Thread: Release X11 Window Control pack (/showthread.php?tid=333002) |
X11 Window Control pack - Takezo36 - 2018-06-21 Hi all, since i needed to maximize kodi again in my plugin i searched for possibilities to do so. In windows the powershell is actually quite powerfull when comes to this kind of tasks, so that was easy... linux not so much. While some plugins rely wmctrl or similar command line programs I didn't like that approach because the user has to install something by himself on his machine. So i found this two libraries which are python only and did the job for me. However they are much more powerful. Things like manipulating an (external) window size or generating an input are possible with those two (e.g. start the browser, bring it to fullscreen and enter a few commands). Since ubuntu dropped wayland basically all the desktops should now use x11. Here are the kodi modules The first is python-xlib which gives you a python binding to the xlib https://github.com/Takezo36/python-xlib/releases/download/kodi0.2.3/script.module.xlib.zip The second one is call pyewmh and is basically a wrapper for python-xlib with the some easy of use functions https://github.com/Takezo36/pyewmh/releases/download/kodi0.1.6/script.module.ewmh.zip a little example from my side would be maximizing kodi after you started an external app from your plugin from ewmh import EWMH ewmh = EWMH() # get the active window which is kodi win = ewmh.getActiveWindow() #blocking call for external app subprocess.call(command, args) #when done set kodi as active window again ewmh.setActiveWindow(win) # flush request ewmh.display.flush() more examples on ewmh here http://ewmh.readthedocs.io/en/latest/ewmh.html#examples I'll try to push them to the repo ... When i understood how to do so. RE: X11 Window Control pack - fleixi - 2018-07-15 I have tried it but without success. In my use case im starting the Spotifyclient and after it is started i like to put kodi in foreground. Code:
The window-id in my logfile is correct and sometimes the kodi-tab is sending a yellow notice in the kde-tablist after the command. But it is never getting in foreground. I have tested wmctl and this is working, but you are completely right saying this is not the best way to do it. RE: X11 Window Control pack - Takezo36 - 2018-07-17 Thats unfortunate i have to admit i only tested this with my gnome. Would you mind trying this instead of setactivewindow ewmh.setWmState(win, 1, "_NET_WM_STATE_MODAL") RE: X11 Window Control pack - fleixi - 2018-07-21 Saddly it doesnt change anything |