From c61f8700fd746dc97b219f8d9c7bf0cf15ad5314 Mon Sep 17 00:00:00 2001 From: Florian Schrofner Date: Sun, 24 Nov 2024 13:51:06 +0100 Subject: [PATCH] use external config file for monitor & workspace configuration --- configs/config-files/bspwm-config | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/configs/config-files/bspwm-config b/configs/config-files/bspwm-config index 367f5b6..c71e87b 100755 --- a/configs/config-files/bspwm-config +++ b/configs/config-files/bspwm-config @@ -15,14 +15,21 @@ ;; setup desktops ;; todo: handle no external display gracefully -(bspc "wm" "-O" "HDMI-A-0" "DisplayPort-2") -(->> (range 1 10) - (map str) - (concat ["monitor" "DisplayPort-2" "-d"]) - (apply bspc)) +;; 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 % #" ")))) -(bspc "monitor" "HDMI-A-0" "-d" "X") +(doseq [config workspace-config] + (let [[monitor & workspaces] config] + (->> workspaces + (map str) + (concat ["monitor" monitor "-d"]) + (apply bspc)))) (config "border_width" "2") (config "window_gap" "12")