summaryrefslogtreecommitdiff
path: root/wide_play_helper.sh
blob: a3de2521224c463d1725a16de566fe65706305c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash


SHORTCUTS=(
    'FUNCTION                     |     TERMINAL EQUIVALENT        |     RECOMMENDED KEYBIND'
    '---------------------------------------------------------------------------------------'
    'Play/Pause Song              |     wide_play_helper.sh -t     |     Shift+F8'
    'Skip to Next Song            |     wide_play_helper.sh -n     |     Shift+F9'
    'Go Back to Previous Song     |     wide_play_helper.sh -p     |     Shift+F10'
    'Toggle Autoplay              |     wide_play_helper.sh -a     |     Ctrl+F9'
    'Toggle Consume               |     wide_play_helper.sh -c     |     Ctrl+F10'
    'Increase Volume              |     wide_play_helper.sh -V     |     Shift+Upper side mouse button'
    'Decrease Volume              |     wide_play_helper.sh -v     |     Shift+Lower side mouse button'
)

next_song="$(mpc queued)"

while getopts "htnpacvV" opt; do
    case $opt in
    h) echo -e "usage: $0 [-h help] [-n notify-send queue] [-l list] [-q queue] [-c clear]\n\nSuggested Keyboard Shortcuts:\n"; printf '%s\n' "${SHORTCUTS[@]}";  exit ;;            # PRINT HELP IN TERMINAL
    t) mpc toggle ; exit;;
    n) [[ -n "$next_song" ]] && mpc next ; exit ;;
    p) mpc cdprev ; exit ;;
    a) mpc single ; exit ;;
    c) mpc consume ; exit ;;
    v) mpc volume -5 ; exit ;;
    V) mpc volume +5 ; exit ;;
    ?) echo "error: option -$OPTARG is not implemented"; exit ;;
    esac
done