Improve pulldowns & status display
This commit is contained in:
21
repl.janet
21
repl.janet
@@ -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")))
|
||||
|
||||
Reference in New Issue
Block a user