summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-08-16 03:10:33 +0300
committerThanos Apollo <[email protected]>2023-08-16 03:10:33 +0300
commit8aee7d5c651199e90f2958f1f217519e3218e3ff (patch)
tree6fc485d3595e02fc8575cc5647aa479054b5b414
parent3da56ca7d9edd32ee12f8e3c369267620c18e987 (diff)
yeetube-toggle-pause-mpv: Add yeetube-socat
Use executable-find for socat shell commands.
-rw-r--r--yeetube.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/yeetube.el b/yeetube.el
index 4a143d0..885534b 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -121,6 +121,8 @@ It's recommended you keep it as the default value."
(defvar yeetube-yt-dlp (executable-find "yt-dlp"))
+(defvar yeetube-socat (executable-find "socat"))
+
(defvar yeetube-content nil)
(defvar yeetube-saved-videos nil)
@@ -220,11 +222,14 @@ It's recommended you keep it as the default value."
(defun yeetube-toggle-pause-mpv ()
"Play/Pause mpv."
(interactive)
- (if (string-match "mpv" yeetube-player)
+ (if (and (string-match "mpv" yeetube-player)
+ yeetube-socat)
(progn
- (shell-command (concat "echo '{ \"command\": [\"cycle\", \"pause\"] }' | socat - " yeetube-mpv-socket))
+ (shell-command
+ (concat "echo '{ \"command\": [\"cycle\", \"pause\"] }' | "
+ yeetube-socat " - " yeetube-mpv-socket))
(message "mpv play/pause"))
- (error "To use this function you need to have mpv installed & set yeetube-player to the default value")))
+ (error "To use this function you need have mpv & socat installed")))
;; Usually titles from youtube get messed up,
;; This should fix some of the common issues.