Compare commits
2 Commits
148dee337e
...
4191f0871b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4191f0871b | ||
|
|
599a6aedcf |
12
main.janet
12
main.janet
@@ -418,6 +418,18 @@
|
|||||||
(defn mark-dirty []
|
(defn mark-dirty []
|
||||||
(:manage-dirty (registry "river_window_manager_v1")))
|
(:manage-dirty (registry "river_window_manager_v1")))
|
||||||
|
|
||||||
|
(defn status-display []
|
||||||
|
(def seat (first (wm :seats)))
|
||||||
|
(def output (seat :focused-output))
|
||||||
|
(string
|
||||||
|
":" (output :tag-main)
|
||||||
|
(case (output :tag-offload)
|
||||||
|
:comma "<"
|
||||||
|
:period ">"
|
||||||
|
"")
|
||||||
|
" "
|
||||||
|
(string/join (map |(string ":" $) (output :tags-other)))))
|
||||||
|
|
||||||
|
|
||||||
(defn action/target-in [obj list dir]
|
(defn action/target-in [obj list dir]
|
||||||
(let [i (or (index-of obj list) -1)]
|
(let [i (or (index-of obj list) -1)]
|
||||||
|
|||||||
25
repl.janet
25
repl.janet
@@ -1,4 +1,25 @@
|
|||||||
(import spork/netrepl)
|
(import spork/netrepl)
|
||||||
|
(import spork/msg)
|
||||||
|
|
||||||
|
(defn run-commands [sock args]
|
||||||
|
(with [stream (net/connect :unix sock)]
|
||||||
|
(def recv (msg/make-recv stream))
|
||||||
|
(def send (msg/make-send stream))
|
||||||
|
(send (string/format "\xFF%j" {:auto-flush false :name ""}))
|
||||||
|
(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)))))
|
||||||
|
|
||||||
|
(defn main [exe & args]
|
||||||
|
(def sock (string (os/getenv "XDG_RUNTIME_DIR") "/censtablo-" (os/getenv "WAYLAND_DISPLAY")))
|
||||||
|
(if (empty? args)
|
||||||
|
(netrepl/client :unix sock)
|
||||||
|
(run-commands sock args)))
|
||||||
|
|
||||||
(defn main [exe]
|
|
||||||
(netrepl/client :unix (string (os/getenv "XDG_RUNTIME_DIR") "/censtablo-" (os/getenv "WAYLAND_DISPLAY"))))
|
|
||||||
|
|||||||
Reference in New Issue
Block a user