Avoid multiple Kodi instances?
#1
Is it possible to configure Kodi so it won't open a new instance when I am launching it (using Linux Mint if it's important), but it will just bring the existing and running instance to the foreground?

Thanks
Reply
#2
PHP Code:
#! /bin/bash
winid=''
winid=$(wmctrl -l|cut -d' ' -f1,5|grep 'Kodi'|cut -d' ' -f1)
if [ ! -
"$winid]
then
        xdotool windowactivate $winid
else
/
usr/bin/kodi &
fi
exit 

Needed tools - xdotool and wmctrl.

wmctrl gets the window list, the first cut gets the names of the windows and the hex ids. We then look for the window called "Kodi" and get the window id for that. Make sure we have found a window ID and set focus on that window using xdotool, else start Kodi.

Tested on Ubuntu 14.04

Save it in a script and then use that to start kodi.
Learning Linux the hard way !!
Reply
#3
Works great, thanks!
Reply

Logout Mark Read Team Forum Stats Members Help
Avoid multiple Kodi instances?1