Debian Codegraph @

bin/fvwm-crystal.mplayer-wrapper

raw
1 #!/bin/bash
2 #
3 # mplayer wrapper for FVWM-Crystal
4 # Written by Dominique Michel <[email protected]>
5 #
6 # This file is used by Music-mplayer to control this player.
7 #
8 # syntax:
9 # fvwm-crystal.mplayer-wrapper <type> <user id> <file>
10 # where
11 # type is one of "list", "file" or "dvd"
12 # user id is the ouput of "id -un"
13 # file is the file to send to mplayer (don't apply with "dvd")
14 #
15 # The 1 in the loadfile command is to append the playlist/file.
16 # If you want to replace it, replace the 1 by 0.
17
18 if [[ "$1" == "list" ]]; then
19 echo "loadlist \"$3\" 1" > /home/"$2"/.mplayer/pipe
20 else
21 if [[ "$1" == "file" ]]; then
22 echo "loadfile \"$3\" 1" > /home/"$2"/.mplayer/pipe
23 else
24 if [[ "$1" == "dvd" ]]; then
25 dvdtitles=`midentify dvd:// | grep ID_DVD_TITLES | sed -ne "s:ID_DVD_TITLES=::p"`
26 count=1
27 dvdpath="dvd://"
28 while [[ "$count" -le "$dvdtitles" ]]; do
29 echo "loadfile "$dvdpath""$count" 1" > /home/"$2"/.mplayer/pipe
30 count=$(($count+1))
31 done
32 fi
33 fi
34 fi