Commit 885bbd06 authored by Sam Moore's avatar Sam Moore
Browse files

Force people to play Qchess

parent 17d3a7ed
# Qchess login script
# Only works with GDM
# WARNING: Don't use on systems without GDM, because it will probably break everything
# Add to root's crontab to run every minute
# Check qchess isn't already running
if [ "$(ps aux | grep -v grep | grep "qchess\.py" | wc -l)" != "0" ]; then
echo "qchess already running" 1>&2
(ps aux | grep -v grep | grep qchess) 1>&2
exit 0
# Check that only GDM is running gnome-session
# This should indicate that the login selection is being shown
non_gdm_sessions=$(ps aux | grep -v grep | grep "$session_types" | awk '{print $1}' | grep -v gdm | wc -l)
if [ "$non_gdm_sessions" != 0 ]; then
echo "$non_gdm_sessions non gdm sessions running" 1>&2
exit 0
# OK, go ahead and do evil stuff
export DISPLAY=:1
cd /home/wheel/matches/progcomp2013/qchess
#espeak "I challenge you to a duel!"
while [ "$win" == "black" ]; do
win=$(./ @human @internal:AgentBishop)
#if [ "$win" == "white" ]; then
# espeak "I'll beat you next time."
# espeak "You dirty, cheating, human."
cd $p
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment