forked from KenT2/python-games
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlauncher.sh
More file actions
58 lines (56 loc) · 1.65 KB
/
launcher.sh
File metadata and controls
58 lines (56 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh
# Thanks to KenT for contributions
RET=0
SOUND=$(zenity --list --width=350 --height=250 --radiolist \
--title="Choose the Audio Output" \
--column "Select" --column="Output" TRUE "Leave as is" FALSE "Auto" FALSE "Force Headphones" FALSE "Force HDMI" )
RET=$?
echo $SOUND
if [ "$SOUND" = "Leave as is" ]; then
echo "Leave as is"
elif [ "$SOUND" = "Auto" ]; then
amixer cset numid=3 0
echo "Auto set"
elif [ "$SOUND" = "Force Headphones" ]; then
amixer cset numid=3 1
echo "Headphones set"
elif [ "$SOUND" = "Force HDMI" ]; then
amixer cset numid=3 2
echo "HDMI set"
else
echo "cancel"
fi
while [ $RET -eq 0 ]; do
GAME=$(zenity --width=350 --height=700 --list \
--title="Choose the Python game to launch" \
--text="Games by Al Sweigart. Manual at inventwithpython.com/pygame" \
--column="Script name" --column="Description" \
flippy "A game like reversi" \
fourinarow "Get four in a row" \
gemgem "A tile matching puzzle" \
inkspill "Flood the screen with pixels" \
memorypuzzle "Test your memory" \
pentomino "5 block Tetris" \
simulate "Repeat the pattern" \
slidepuzzle "Traditional slide puzzle" \
squirrel "Eat the smaller squirrels" \
starpusher "Sokoban" \
tetromino "Tetris-like game" \
tetrominoforidiots "Tetris for Idiots" \
wormy "Snake-like game" \
website "inventwithpython.com")
RET=$?
echo $RET
if [ "$RET" -eq 0 ]
then
if [ "$GAME" = "website" ]
then
sensible-browser "http://inventwithpython.com/pygame"
else
if [ "$GAME" != "" ]; then
cd /home/pi/python_games
python $GAME.py
fi
fi
fi
done