2022-02-05 14:23:32 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
2023-10-24 16:00:57 +00:00
|
|
|
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
function sendkey() {
|
|
|
|
echo '{"command":["keypress", "'${1}'"]}' | socat - "/tmp/mpvsocket"
|
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
"pause")
|
|
|
|
sendkey "p"
|
|
|
|
;;
|
2023-10-25 22:59:54 +00:00
|
|
|
"changeaudio")
|
|
|
|
sendkey "#"
|
|
|
|
;;
|
|
|
|
"changesub")
|
|
|
|
sendkey "j"
|
|
|
|
;;
|
|
|
|
"showosd")
|
|
|
|
sendkey "O"
|
2022-02-05 14:23:32 +00:00
|
|
|
;;
|
|
|
|
"back5s")
|
|
|
|
sendkey "LEFT"
|
|
|
|
;;
|
2023-10-25 22:59:54 +00:00
|
|
|
"skip5s")
|
|
|
|
sendkey "RIGHT"
|
2022-02-05 14:23:32 +00:00
|
|
|
;;
|
|
|
|
"back60s")
|
|
|
|
sendkey "DOWN"
|
|
|
|
;;
|
2023-10-25 22:59:54 +00:00
|
|
|
"skip60s")
|
|
|
|
sendkey "UP"
|
|
|
|
;;
|
2022-02-05 14:23:32 +00:00
|
|
|
"quit")
|
2023-10-25 22:59:54 +00:00
|
|
|
sendkey "Q"
|
2022-02-05 14:23:32 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|