diff options
author | Thanos Apollo <[email protected]> | 2023-08-18 10:04:34 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-08-18 10:04:34 +0300 |
commit | 9846b345521cf05f3614974d73eac7bb86d829a4 (patch) | |
tree | ef7bbc76121378c818a571f744b4dba079d734dc /yeetube.el | |
parent | 1a525af84ae77050c38ff604bd183650bd842a81 (diff) |
Change yeetube-toggle-pause-mpv
Use yeetube--send-command instead of socat
Diffstat (limited to 'yeetube.el')
-rw-r--r-- | yeetube.el | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -249,15 +249,16 @@ It's recommended you keep it as the default value." (defun yeetube-toggle-pause-mpv () "Toggle play/pause mpv." (interactive) - (let ((socat (executable-find "socat"))) - (unless socat (error "Required program 'socat' not found")) - (unless (string-match "mpv" yeetube-player) - (error "Not using mpv as yeetube-player")) - (when (and (string-match "mpv" yeetube-player) socat) - (shell-command - (format "echo '{ \"command\": [\"cycle\", \"pause\"] }' | %s - %s" - socat yeetube-mpv-socket)) - (message "mpv toggle pause")))) + (unless (string-match "mpv" yeetube-player) + (error "Not using mpv as yeetube-player")) + (yeetube--send-command 'cycle 'pause)) + +(defun yeetube-toggle-video-mpv () + "Toggle video on/off mpv." + (interactive) + (unless (string-match "mpv" yeetube-player) + (error "Not using mpv as yeetube-player")) + (yeetube--send-command 'cycle 'video)) ;; Usually titles from youtube get messed up, ;; This should fix some of the common issues. |