]> git.phdru.name Git - audio-cdr-video.git/blob - audio/players/action
Initail import
[audio-cdr-video.git] / audio / players / action
1 #! /bin/sh
2
3 action="$1"
4
5 if pgrep smplayer >/dev/null; then
6    if [ "$action" = prev ]; then
7       exec smplayer -send-action play_prev
8    elif [ "$action" = next ]; then
9       exec smplayer -send-action play_next
10    elif [ "$action" = pause ]; then
11       exec smplayer -send-action play_or_pause
12    elif [ "$action" = stop ]; then
13       exec smplayer -send-action stop
14    fi
15
16 elif pgrep deadbeef >/dev/null; then
17    if [ "$action" = prev ]; then
18       exec deadbeef --prev
19    elif [ "$action" = next ]; then
20       exec deadbeef --next
21    elif [ "$action" = pause ]; then
22       exec deadbeef --toggle-pause
23    elif [ "$action" = stop ]; then
24       exec deadbeef --stop
25    fi
26
27 elif pgrep audacious >/dev/null; then
28    if [ "$action" = prev ]; then
29       exec audacious --rew
30    elif [ "$action" = next ]; then
31       exec audacious --fwd
32    elif [ "$action" = pause ]; then
33       exec audacious --play-pause
34    elif [ "$action" = stop ]; then
35       exec audacious --stop
36    fi
37
38 else
39    echo "Cannot find an audioplayer" >&2
40    exit 1
41 fi