can't imagine an easier dev experience

Created: Feb 20, 2021Published: Mar 28, 2023Last modified: Apr 05, 2023
No tags
Word count: 29

i just can't imagine an easier dev experience

  • auto-imports just by typing
  • lispyville for yanking forms
  • eval-in-place via the repl
(ns clawe.awesome.rules
  "Manages the awesomeWM rules."
  (:require [clawe.awesome :as awm]
            [clawe.workspaces :as workspaces]
            [clojure.string :as string]
            [clojure.walk :as walk]))

(comment
  (println "howdy")

  ;; trying to read the rules here, not yet parseable
  (awm/awm-fnl
    '(view awful.rules.rules))
  )

(defn write-awesome-rules []
  (let [wsp-rules
        (->> (workspaces/all-workspaces)
             (keep :awesome/rules)
             (walk/postwalk (fn [x]
                              (if (seq? x)
                                (into [] x)
                                x)))
             (string/join "\n")
             (#(string/replace % "," "")))
        file-contents
        (str "{:all [" wsp-rules "]}")]

    (spit "/home/russ/.config/awesome/workspace-rules-magic.fnl" file-contents)))

(comment
  (let [x [:a '(:a :b)]]
    (map (fn [y]
           (if (seq? y) (into [] y) y)
           ) x))

  (->> (workspaces/all-workspaces)
       (keep :awesome/rules)
       (walk/postwalk (fn [x]
                        (if (seq? x)
                          (do
                            (into [] x))
                          x)))
       (string/join "\n")
       )
  (write-awesome-rules))