diff options
author | Thanos Apollo <[email protected]> | 2023-08-19 04:57:42 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-08-19 04:57:42 +0300 |
commit | 0dc06ff5d607f6297fee66793f6a689374962293 (patch) | |
tree | fc1e308a45f2328f108e9c2b2de9dfed11c1ef87 | |
parent | 89138c3c9effd2b7d58510e7e215e29647682b9a (diff) |
Rewrite yeetube-start-process
-rw-r--r-- | yeetube.el | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -209,21 +209,16 @@ Example Usage: (when clear-saved (setq yeetube-saved-videos nil)))) -(defun yeetube--mpv-play (url) - "Use mpv to play URL." - (let ((mpv (executable-find "mpv")) - (socket (concat (temporary-file-directory) "yeetube-socket")) - (process-name "yeetube")) +(defun yeetube-start-process (command) + "Start yeetube process for shell COMMAND." + (let ((process-name "yeetube")) (dolist (process (process-list)) (when (string-match process-name (process-name process)) (kill-process process))) (sit-for 0.1) (unless (get-process process-name) (start-process-shell-command - "yeetube" nil - (if yeetube-mpv-disable-video - (format "%s --no-video --input-ipc-server=%s %s" mpv socket url) - (format "%s --input-ipc-server= %s %s" mpv socket url)))))) + "yeetube" nil command)))) (defun yeetube-mpv-toggle-disable-video () "Disable/Enable video for mpv player." |