Yeah! Finally I wrote this script that works PERFECTLY!!!!
First of all follow this instructions for Kodibuntu (I don't apply the PulseAudio because I use ALSA for all):
http://forum.kodi.tv/showthread.php?tid=...pid1919154
Then put the following in a terminal:
sudo nano $HOME/.config/openbox/start.sh
And paste this code:
Quote:#!/bin/bash
while [ 1 ] # do forever
do
steampid=$(pidof steam)
kodipid=$(pidof kodi.bin)
firefoxpid=$(pidof firefox)
if [ -z $kodipid ]; then # checks if kodi is running if not..
if [ -z $steampid ]; then # checks if steam is running if not...
if [ -z $firefoxpid ]; then # checks if firefox is running if not...
/usr/bin/kodi
else # If Firefox is running, then....
echo ""
fi
else # If Steam is running, then....
echo ""
fi
sleep 1
else # If Kodi is running, then....
echo ""
fi
sleep 1
done
done &
Save it (CTRL+X and then ENTER) and now in a terminal again put:
sudo nano $HOME/.config/openbox/autostart.sh
change the line
/usr/bin/kodi & with
/home/YOURUSERNAME/.config/openbox/start.sh & ; save it and restart.
EDIT: I wrote it with 3 variables (Kodi, Firefox and Steam). If you don't use Firefox, please, use this script instead the previous:
Quote:#!/bin/bash
while [ 1 ] # do forever
do
steampid=$(pidof steam)
kodipid=$(pidof kodi.bin)
firefoxpid=$(pidof firefox)
if [ -z $kodipid ]; then # checks if kodi is running if not..
if [ -z $steampid ]; then # checks if steam is running if not...
/usr/bin/kodi
else # If Steam is running, then....
echo ""
fi
sleep 1
else # If Kodi is running, then....
echo ""
fi
sleep 1
done
done &
Make executable the script with
sudo chmod +x $HOME/.config/openbox/start.sh
HOW WORKS THE SCRIPT?
Ok. The complete script (3 variables) works like:
- If Kodi is running, nothing happens.
- If Kodi isn't running BUT Steam yes, nothing happens (With Steam launcher and the "quit kodi" option enabled, only Steam is runnning).
- If Kodi isn't running, Steam isn't running BUT Firefox yes, nothing happens (you only have running Firefox).
- If Kodi isn't running, Steam isn't running and Firefox isn't running, Kodi starts again (very useful for ocasionally Kodi crashes).
EDIT2: For launch Firefox or another browser I use this script with Executor (or Advanced Launcher):
Quote:#!/bin/bash
killall -9 kodi.bin
firefox
killall -9 firefox
/usr/bin/kodi
Regards.