;;; LIB.fnl ;; Radish library (local util (require :util)) (local pls (require :pls)) (local mpv (require :mpv)) (local protocols {:http (fn [url] (mpv.play)) :https :find :shuf :noise}) (local radish-config (.. (or (os.getenv :XDG_CONFIG_HOME) (.. (os.getenv :HOME) :/.config)) :/radish/stations)) (local radish-pid :/tmp/radish.pid) (local radish-lp (.. (or (os.getenv :XDG_CACHE_HOME) (.. (os.getenv :HOME) :/.cache)) :/radish.lastplayed)) (local radish-status :/tmp/radish.status) (fn play [?station] "Begin playing STATION. STATION can be a stream using one of `protocols', which see. If it's not present, or if STATION doesn't match a protocol in `protocols', allow the user to choose one from their favorites.") (fn kill [] "Kill the current invocation of `radish'." (let [pid ()])) (fn add [?station] (print :add)) (fn del [?station] (print :del)) (fn edit [?station] (print :edit)) {: play : kill : add : del : edit}