2022-02-05 14:23:32 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
2023-10-23 22:46:49 +00:00
|
|
|
# Copyright (C) 2023-present - The JELOS Project (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"
|
|
|
|
;;
|
|
|
|
"skip5s")
|
|
|
|
sendkey "RIGHT"
|
|
|
|
;;
|
|
|
|
"back5s")
|
|
|
|
sendkey "LEFT"
|
|
|
|
;;
|
|
|
|
"skip60s")
|
|
|
|
sendkey "UP"
|
|
|
|
;;
|
|
|
|
"back60s")
|
|
|
|
sendkey "DOWN"
|
|
|
|
;;
|
|
|
|
"quit")
|
|
|
|
sendkey "q"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|