mirror of
https://github.com/GRFreire/dotfiles.git
synced 2026-01-10 04:19:38 +00:00
control media with MPRIS instead of manually
This commit is contained in:
parent
8e5ab44410
commit
3b43a6156e
@ -1,35 +1,15 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
control_play() {
|
|
||||||
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
|
|
||||||
mpc toggle
|
|
||||||
}
|
|
||||||
|
|
||||||
control_stop() {
|
|
||||||
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop
|
|
||||||
mpc stop
|
|
||||||
}
|
|
||||||
|
|
||||||
control_next() {
|
|
||||||
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
|
|
||||||
mpc next
|
|
||||||
}
|
|
||||||
|
|
||||||
control_prev() {
|
|
||||||
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
|
|
||||||
mpc prev
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
# Control
|
# Control
|
||||||
play )
|
play )
|
||||||
control_play ;;
|
playerctl play-pause ;;
|
||||||
stop )
|
stop )
|
||||||
control_stop ;;
|
playerctl stop ;;
|
||||||
next )
|
next )
|
||||||
control_next ;;
|
playerctl next ;;
|
||||||
prev )
|
prev )
|
||||||
control_prev ;;
|
playerctl previous ;;
|
||||||
|
|
||||||
# Volume
|
# Volume
|
||||||
vol_up )
|
vol_up )
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user