diff options
author | Thanos Apollo <[email protected]> | 2023-07-16 07:35:08 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-07-16 07:38:59 +0300 |
commit | 3eb98ccaba88846c41a83f124ff44bdbb963ba38 (patch) | |
tree | b057d863d46b3d018e67119f6a1be0dde3fc3cfb | |
parent | c4ae1a5d82b38d6c86c16f109d32846b1dddf46f (diff) |
yeetube--mpv-socket: use temporary-file-directory
-rw-r--r-- | yeetube.el | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -74,14 +74,11 @@ Example Usage: :safe #'booleanp :group 'yeetube) -(defcustom yeetube--mpv-socket "/tmp/mpvsocket" - "MPV Input Socket." - :type 'string - :safe #'stringp - :group 'yeetube) +(defvar yeetube-mpv-socket (concat temporary-file-directory "yeet-socket") + "MPV Input Socket.") (defcustom yeetube-player (concat - (executable-find "mpv") " --input-ipc-server=" yeetube--mpv-socket) + (executable-find "mpv") " --input-ipc-server=" yeetube-mpv-socket) "Select default video player. It's recommended you keep it as the default value." @@ -136,7 +133,7 @@ It's recommended you keep it as the default value." (defun yeetube-toggle-video-mpv () "Toggle video on/off for mpv player." (interactive) - (let ((socket (concat " --input-ipc-server=" yeetube--mpv-socket)) + (let ((socket (concat " --input-ipc-server=" yeetube-mpv-socket)) (no-video " --no-video") (mpv (executable-find "mpv"))) (setq yeetube-player @@ -149,7 +146,7 @@ It's recommended you keep it as the default value." (interactive) (if (string-match "mpv" yeetube-player) (progn - (shell-command (concat "echo '{ \"command\": [\"cycle\", \"pause\"] }' | socat - " yeetube--mpv-socket)) + (shell-command (concat "echo '{ \"command\": [\"cycle\", \"pause\"] }' | 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"))) |