1
0
Fork 0

use external config file for monitor & workspace configuration

master
Florian Schrofner 2024-11-24 13:51:06 +01:00
parent 6fa17f0d53
commit c61f8700fd
1 changed files with 13 additions and 6 deletions

View File

@ -15,14 +15,21 @@
;; setup desktops
;; todo: handle no external display gracefully
(bspc "wm" "-O" "HDMI-A-0" "DisplayPort-2")
(->> (range 1 10)
;; read workspace configuration from config
;; format should be like: eDP-1 1 2 3 4 .., HDMI-A-0 X
;; where each monitor is defined on a separate line (no commas)
(def workspace-config
(->> (slurp "/home/schrofi/.screenlayout/default-workspaces")
(str/split-lines)
(map #(str/split % #" "))))
(doseq [config workspace-config]
(let [[monitor & workspaces] config]
(->> workspaces
(map str)
(concat ["monitor" "DisplayPort-2" "-d"])
(apply bspc))
(bspc "monitor" "HDMI-A-0" "-d" "X")
(concat ["monitor" monitor "-d"])
(apply bspc))))
(config "border_width" "2")
(config "window_gap" "12")