blob: 622a4d099c2f41e5f3563524d03e1c022e8cc433 [file] [log] [blame]
Jouni Malinencd4e3c32015-10-29 12:39:56 +02001#!/bin/sh
2
3STATE=$1
4shift
5OPER=$*
6
7play()
8{
9 canberra-gtk-play --file=$1 &
10}
11
12
13if [ "$STATE" = "START" ]; then
14 zenity --title="NFC operation" --info --text="$OPER" &
15 echo $! > nfc-status.pid
16 play /usr/share/sounds/ubuntu/stereo/system-ready.ogg
17 #espeak "NFC $OPER"
18fi
19
20if [ "$STATE" = "SUCCESS" -o "$STATE" = "FAIL" ]; then
21 if [ -r nfc-status.pid ]; then
22 pid=`cat nfc-status.pid`
23 rm nfc-status.pid
24 if [ $pid -gt 0 ]; then
25 if ps -o command $pid | grep -q zenity; then
26 kill $pid
27 fi
28 fi
29 fi
30fi
31
32if [ "$STATE" = "SUCCESS" ]; then
33 play /usr/share/sounds/freedesktop/stereo/complete.oga
34 #espeak "Success"
35fi
36
37if [ "$STATE" = "FAIL" ]; then
38 play /usr/share/sounds/freedesktop/stereo/bell.oga
39 #espeak "Failed"
40fi