2015-09-26, 01:51
(2015-09-24, 00:39)Falkor Wrote: Hi All!!
Long time reader but this is my first post and I hope it helps someone.
My system is an Ubuntu-gnome 14.04 and since I insatlled NetfilXBMC every time I exit Chrome (ctrl+w) it lost focus on Kodi making me select it again to get focus. (Sorry about my english by the way).
I find a workaround and I wanted to share with all of you, it is not elegant, it is not pretty, but it works for me, maybe it works for someone else.
In "default.py" I inserted a line after line number 751, just after this one:
Quote:xbmc.executebuiltin("RunPlugin(plugin://plugin.program.chrome.launcher/?url="+urllib.quote_plus(url)+"&mode=showSite&kiosk="+kiosk+profileFolder+")")
The line I inserted is:
Quote:os.system('sleep 5; while [ "$(ps -ef | grep -i "plugin.video.netflixbmc/chrome" | grep -v grep)" != "" ]; do sleep 2; done ; wmctrl -a Kodi')
Again, I hope this helps.
With this change, every time I exit Chrome (ctrl+w) the focus is in Kodi instead of an empty desktop.
I hope this will help someone.
BTW: You must have installed wmctrl (sudo apt-get install wmctrl)
I have noticed that making the above changes keeps the script from hidding the mouse pointer (cursor), so I figure out that the line I purposed should be running in the background.
I came up with this:
Quote:os.system('{ sleep 5; while [ "$(ps -ef | grep -i "plugin.video.netflixbmc/chrome" | grep -v grep)" != "" ]; do sleep 2; done ; wmctrl -a Kodi; } &')
instead of this:
Quote:os.system('sleep 5; while [ "$(ps -ef | grep -i "plugin.video.netflixbmc/chrome" | grep -v grep)" != "" ]; do sleep 2; done ; wmctrl -a Kodi')
Note the brackets and the "&" sign. It will now run on the background, so hiding mouse pointer is done (and then some other things.. :-D )
BTW: The browser.sh was not executing because it was not made executable (chmod +x), and kiosk mode was not working because there was already a session of google-chrome running (with my own profile)