document the change in prompt timeout handling
[vlock.git] / scripts / amarok.sh
blob8aea162db4b870205db9a4686587aecee0c290df
1 #!/bin/sh
2 # amarok.sh -- amarok pausing script for vlock,
3 # the VT locking program for linux
4 #
5 # This program is copyright (C) 2007 Frank Benkstein, and is free software. It
6 # comes without any warranty, to the extent permitted by applicable law. You
7 # can redistribute it and/or modify it under the terms of the Do What The Fuck
8 # You Want To Public License, Version 2, as published by Sam Hocevar. See
9 # http://sam.zoy.org/wtfpl/COPYING for more details.
11 set -e
13 DEPENDS="all"
15 hooks() {
16 while read hook_name ; do
17 case "${hook_name}" in
18 vlock_start)
19 amarok_status=$(dcop amarok player isPlaying 2>/dev/null || echo false)
20 if [ "${amarok_status}" = "true" ] ; then
21 dcop amarok player pause
24 vlock_end)
25 if [ "${amarok_status}" = "true" ] ; then
26 dcop amarok player play
29 esac
30 done
33 if [ $# -ne 1 ] ; then
34 echo >&2 "Usage: $0 <command>"
35 exit 1
38 case "$1" in
39 hooks)
40 hooks
42 preceeds)
43 echo "${PRECEEDS}"
45 succeeds)
46 echo "${SUCCEEDS}"
48 requires)
49 echo "${REQUIRES}"
51 needs)
52 echo "${NEEDS}"
54 depends)
55 echo "${DEPENDS}"
57 conflicts)
58 echo "${CONFLICTS}"
61 echo >&2 "$0: unknown command '$1'"
62 exit 1
64 esac