27 lines
		
	
	
	
		
			824 B
		
	
	
	
		
			Common Lisp
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
	
		
			824 B
		
	
	
	
		
			Common Lisp
		
	
	
		
			Executable file
		
	
	
	
	
#!/usr/bin/env -S sbcl --script
 | 
						|
(require "uiop")
 | 
						|
(load "/home/chris/.sbclrc")
 | 
						|
(ql:quickload :serapeum)
 | 
						|
 | 
						|
(defvar *url* (car (uiop:command-line-arguments)))
 | 
						|
 | 
						|
;; (uiop:println *url*)
 | 
						|
;; (uiop:println (type-of *url*))
 | 
						|
 | 
						|
(defun main ()
 | 
						|
  (if (serapeum:string-contains-p "inv.cochrun.xyz" *url*)
 | 
						|
      (run-program "mpv"
 | 
						|
                   `("--ontop"
 | 
						|
                     "--keepaspect-window"
 | 
						|
                     ,(serapeum:string-replace-all
 | 
						|
                       "inv.cochrun.xyz" *url* "youtube.com"))
 | 
						|
                   :search "/run/current-system/sw/bin/"
 | 
						|
                   :output t)
 | 
						|
      (run-program "mpv"
 | 
						|
                   `("--ontop"
 | 
						|
                     "--keepaspect-window"
 | 
						|
                     ,(string *url*))
 | 
						|
                   :search "/run/current-system/sw/bin/"
 | 
						|
                   :output t)))
 | 
						|
 | 
						|
 (main)
 |