this repo has no description

feat: add grimblastr

+30
+30
grimblastr/grimblastr.bb
··· 1 + #!/usr/bin/env bb 2 + ;;; wofi wrapper for grimblast 3 + (require '[babashka.process :refer [shell]] 4 + '[clojure.string :as str]) 5 + 6 + (def menus [["copysave" 7 + "copy" 8 + "save" 9 + "edit"] 10 + 11 + ["area" 12 + "active" 13 + "screen" 14 + "output"]]) 15 + 16 + (defn run-dmenu! [list-items] 17 + (let [stdin (str/join "\n" list-items)] 18 + (shell {:out :string :in stdin} 19 + "wofi --show dmenu"))) 20 + 21 + (def do-dmenu! (comp str/trim :out run-dmenu!)) 22 + 23 + (defn main [& args] 24 + (try 25 + (let [[command target] (map do-dmenu! menus)] 26 + (shell "grimblast" command target)) 27 + (catch Exception e))) 28 + 29 + (when (= *file* (System/getProperty "babashka.file")) 30 + (apply main *command-line-args*))