4 # Launches a game. Works both on $1 (an argument) and $0 (the actually name
5 # of the script, presumably a symlink). Takes care of killing troublemaking
6 # games, pausing unclutter, remapping the keyboard, and setting an away
9 pkill -INT `basename $0`-bin
13 pkill -9 `basename $0`-bin
15 [ "$DISPLAY" = "127.0.0.1:7.0" ] && DISPLAY=:1.0
17 #[ -f "$HOME/.activity" ] && mv "$HOME/.activity" "$HOME/.activity.$$.bak"
18 tpope activity > "$HOME/.activity.$$.bak"
19 #echo "Playing `basename $0`" > "$HOME/.activity"
20 echo "Playing `basename $0`"|tpope activity -
23 xmodmap "$HOME/.Xmodmap" || xmodmap "$HOME/.xmodmap"
26 xmodmap -e "keysym Super_L = F13"
27 xmodmap -e "keysym Hyper_L = F14"
28 xmodmap -e "keysym Super_R = F15"
30 for suffix in '_demo' '-demo' 'demo' ''; do
31 [ -x "/usr/local/bin/`basename $0`$suffix" ] && \
32 binary=/usr/local/bin/`basename $0`$suffix
35 if [ "`basename $0`" = gamelaunch ]; then
40 $binary "$@" 2>&1 | tee "$HOME/.`basename $binary`.log"
44 xmodmap "$HOME/.Xmodmap" || xmodmap "$HOME/.xmodmap"
46 #rm -f "$HOME/.activity"
47 #[ -f "$HOME/.activity.$$.bak" ] && mv "$HOME/.activity.$$.bak" "$HOME/.activity"
48 cat "$HOME/.activity.$$.bak"|tpope activity -
49 rm -f "$HOME/.activity.$$.bak"