ZVLFS7DOBMSEN6Z6TSZHO5RAGEI2ECMAUQVXHGB4EFJA4TYWZUFAC
(def data
(with [pipe (os/spawn ["bspc" "wm" "-d"] :p {:out :pipe})]
(:read (pipe :out) :all)))
(defn current-desktop []
(let [data
(with [pipe (os/spawn ["bspc" "wm" "-d"] :p {:out :pipe})]
(:read (pipe :out) :all))
state
(json/decode data)
monitor
(item-with-id (state "focusedMonitorId") (state "monitors"))]
(item-with-id (monitor "focusedDesktopId") (monitor "desktops"))))
(defn zoom-in []
(let [desktop (current-desktop)
unhidden (fully-unhidden (desktop "root"))
focused-node-id (desktop "focusedNodeId")]
(let [unhidden (fully-unhidden (desktop "root"))]
(when unhidden
(match unhidden
{"firstChild" :null "secondChild" :null} (toggle-hidden unhidden)
{"firstChild" first "secondChild" second} (toggle-hidden
(not-focused (desktop "focusedNodeId") first second)))))
(match (args 1)
"in" (zoom-in)
"out" (zoom-out)
command (print "Comando não reconhecido: " command))))