5 # WARNING: Don't use on systems without GDM, because it will probably break everything
6 # Add to root's crontab to run every minute
8 # Check qchess isn't already running
9 if [ "$(ps aux | grep -v grep | grep "qchess\.py" | wc -l)" != "0" ]; then
10 echo "qchess already running" 1>&2
11 (ps aux | grep -v grep | grep qchess) 1>&2
15 # Check that only GDM is running gnome-session
16 # This should indicate that the login selection is being shown
17 session_types="gnome-session\|kdeinit"
18 non_gdm_sessions=$(ps aux | grep -v grep | grep "$session_types" | awk '{print $1}' | grep -v gdm | wc -l)
20 if [ "$non_gdm_sessions" != 0 ]; then
21 echo "$non_gdm_sessions non gdm sessions running" 1>&2
25 # OK, go ahead and do evil stuff
29 cd /home/wheel/matches/progcomp2013/qchess
32 #espeak "I challenge you to a duel!"
33 while [ "$win" == "black" ]; do
34 win=$(./qchess.py @human @internal:AgentBishop)
37 #if [ "$win" == "white" ]; then
38 # espeak "I'll beat you next time."
40 # espeak "You dirty, cheating, human."