babashka/examples/rofi.clj
Russell Matney 8da8b3ffb8
Add rofi example [skip ci] (#651)
Rofi is a linux modal menu for fuzzy filtering, with a similar UX to
Alfred or Spotlight on OSX.

Borrows quite directly from the fzf example.
2020-11-17 17:54:02 +01:00

12 lines
308 B
Clojure

(require '[babashka.process :as p])
(defn rofi [s]
(let [proc (p/process
["rofi" "-i" "-dmenu" "-mesg" "Select" "-sync" "-p" "*"]
{:in s :err :inherit
:out :string})]
(:out @proc)))
(rofi (slurp *in*))
;; `echo "hi\nthere\nclj" | bb examples/rofi.clj`