[quickstart] Import v1.00r1 released on 2008/03/06
[quickstart] / quickstart / quickstart
1 #!/bin/bash
2 #
3 # Sample application launcher.
4 # Angelo Arrifano <miknix@gmail.com>
5 # http://quickstart.sourceforge.net
6
7 # Put this script on ~/.config/autostart.
8 #
9
10 # Add your button actions here
11 LAUNCH["QBTN"]="freevo"
12 LAUNCH["DBTN"]="amarok -l ~/playlist.m3u -p"
13
14 # The sysfs file telling which button was pressed
15 PRESSEDFILE="/sys/devices/platform/quickstart/pressed_button"
16
17 if [[ ! -e "$PRESSEDFILE" ]]; then
18         exit 1
19 fi
20
21 PRESSEDBUTTON="$(cat "$PRESSEDFILE")"
22
23 if [[ "$PRESSEDBUTTON" != "none" ]]; then
24         echo -n "none" > "$PRESSEDFILE"
25         ${LAUNCH[$PRESSEDBUTTON]}; exit $?
26 fi
27 exit 1