streamlink.lisp 662 B

123456789101112131415161718192021
  1. (in-package :stumpwm)
  2. (defvar *streamlink-program* "streamlink")
  3. (defvar *streamlink-arguments* '("-p" "mpv"))
  4. (defvar *streamlink-player-arguments* nil)
  5. (defvar *streamlink-quality* "best")
  6. (defcommand xclip-streamlink () ()
  7. "Play video from clipboard with streamlink."
  8. (run-shell-command
  9. (join `(,*streamlink-program*
  10. ,@*streamlink-arguments*
  11. ,@(if *streamlink-player-arguments*
  12. `("--player-args" ,(single-quote-string
  13. (join *streamlink-player-arguments*
  14. #\ ))))
  15. ,(get-x-selection)
  16. ,*streamlink-quality*))))