Improve pulldowns & status display

This commit is contained in:
bluepython508
2026-02-16 11:12:26 +00:00
parent 8edac33374
commit b51f5f5313
2 changed files with 95 additions and 60 deletions

View File

@@ -3,19 +3,20 @@
(defn run-commands [sock args]
(with [stream (net/connect :unix sock)]
(def recv (msg/make-recv stream))
(def recv- (msg/make-recv stream))
(def send (msg/make-send stream))
(send (string/format "\xFF%j" {:auto-flush false :name ""}))
(send (string/format "\xFF%j" {:auto-flush true :name ""}))
(defn recv []
(def ms (recv-))
(case (ms 0)
nil ms
0xFF (do (prin (slice ms 1)) (recv))
0xFE (slice ms 1))
ms)
(def prompt (recv))
(each arg args
(send (string "\xFF" arg))
(def [ok val] (-> (recv)
(parse)))
(if (string? val)
(print val)
(pp val))
(unless ok
(os/exit 1)))))
(send arg)
(loop [:until (= prompt (recv))]))))
(defn main [exe & args]
(def sock (string (os/getenv "XDG_RUNTIME_DIR") "/censtablo-" (os/getenv "WAYLAND_DISPLAY")))