playvid: filter out directories

This commit is contained in:
LordMZTE 2023-05-14 00:04:07 +02:00
parent 4460f34a41
commit 0951917e27
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6

View file

@ -9,10 +9,11 @@
(current-print void)
(define file
(command-line
;; default to random file
#:args ([f (let ([dir (directory-list)]) (path->string (list-ref dir (random (length dir)))))])
f))
;; default to random file
(command-line #:args ([f
(let ([dir (filter file-exists? (directory-list))])
(path->string (list-ref dir (random (length dir)))))])
f))
(printf "playing: ~a\n" file)
(system* (find-executable-path "mpv") file)