-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththqm-media
executable file
·47 lines (44 loc) · 1.26 KB
/
thqm-media
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash
# This script uses thqm to create a dashboard to control the playback and volume
# of media playing on the host.
# Requires xdotool, pactl
media_control() {
while IFS= read -r event; do
case "$event" in
"Raise volume")
pactl set-sink-volume @DEFAULT_SINK@ +10%
;;
"Lower volume")
pactl set-sink-volume @DEFAULT_SINK@ -10%
;;
"Mute/Unmute")
pactl set-sink-mute @DEFAULT_SINK@ toggle
;;
"Play/Pause")
xdotool key --clearmodifiers XF86AudioPlay
;;
"Previous")
xdotool key --clearmodifiers XF86AudioPrev
;;
"Next")
xdotool key --clearmodifiers XF86AudioNext
;;
"Scrub right")
xdotool key --clearmodifiers Right
;;
"Scrub left")
xdotool key --clearmodifiers Left
;;
"Space")
xdotool key --clearmodifiers space
;;
*)
# pass through
echo "$event"
;;
esac
done
}
printf "Raise volume\nLower volume\nMute/Unmute\nPlay/Pause\nPrevious\nNext\nScrub right\nScrub left\nSpace" |
thqm --title="media" "$@" |
media_control