I finally wrote 2 script to sove this issue:
The fisrt scrip is lauchin kstar and them enter in a loop test to see if kstar is still alive. If it is not I send an email and I restart kastar using the second script.
The second script is based on xdotool that allows to automate mouse click relative to windows: with this one I relauche Ekos, reload the scheduled file (with is always named the same) and restart the scheduler.
Here are the 2 scripts:
1) First script
#!/bin/bash
kstars&
sleep 30
while true; do
ps h -C kstars>/dev/null
status=$?
if test $status -eq 1
then
echo "kstars just crashed" | mail -s "kstars" This email address is being protected from spambots. You need JavaScript enabled to view it.
~/xdoscriptall
fi
sleep 120;done
2) Second script
#!/bin/bash
kstars&
sleep 30
Kstars=`xwininfo -name "KStars" -int|grep "Window id"|cut -c22-30`
Astuce=`xwininfo -name "Astuce du jour — KStars" -int|grep "Window id"|cut -c22-30`
xdotool windowactivate $Astuce mousemove --window $Astuce 518 300 click 1 sleep 2
xdotool windowactivate $Kstars mousemove --window $Kstars 919 45 click 1 sleep 10
Ekos=`xwininfo -name "Ekos — KStars" -int|grep "Window id"|cut -c22-30`
xdotool windowactivate $Ekos mousemove --window $Ekos 1055 109 click 1 sleep 20
xdotool windowactivate $Ekos sleep 10 mousemove --window $Ekos 116 34 click 1 sleep 10
xdotool windowactivate $Ekos mousemove --window $Ekos 1476 105 click 1 sleep 10 type "/media/Astro/tst.esl"
Open=`xwininfo -name "Open Ekos Scheduler List" -int|grep "Window id"|cut -c22-30`
xdotool windowactivate $Open mousemove --window $Open 775 600 click 1 sleep 5
xdotool windowactivate $Ekos mousemove --window $Ekos 650 615 click 1 sleep 5

Read More...