From dfce77913b72f933043fb0f9da47cd3387405f53 Mon Sep 17 00:00:00 2001 From: Nickolaj Jepsen Date: Sat, 13 Dec 2025 16:06:58 +0100 Subject: [PATCH] feat: update dms setup --- flake.lock | 48 ++++++++++++++++++------------------ modules/desktop/dms/bar.nix | 49 ++++++++++++++++++++++++++++++------- 2 files changed, 64 insertions(+), 33 deletions(-) diff --git a/flake.lock b/flake.lock index b185042..f279ebd 100644 --- a/flake.lock +++ b/flake.lock @@ -58,11 +58,11 @@ "quickshell": "quickshell" }, "locked": { - "lastModified": 1765576432, - "narHash": "sha256-cP9fIrEe6UXG3vpSjHMvl9i4717DA2AmUZEdiwQro5w=", + "lastModified": 1765637104, + "narHash": "sha256-HN8z1seZbjjZsGnfAoO3vIlLgl0Ob9Mb2bm0rAjqGog=", "owner": "AvengeMedia", "repo": "DankMaterialShell", - "rev": "6c3c722674ae2df8a74fc2dc4329c722165b9512", + "rev": "31b67164c7af7c648d655b02fec379a2225370df", "type": "github" }, "original": { @@ -121,11 +121,11 @@ ] }, "locked": { - "lastModified": 1762835999, - "narHash": "sha256-UykYGrGFOFTmDpKTLNxj1wvd1gbDG4TkqLNSbV0TYwk=", + "lastModified": 1765583951, + "narHash": "sha256-QDCrQorCAesnsOQJk+cTszazGitf9NDqIEMxzUEtotE=", "owner": "AvengeMedia", "repo": "dgop", - "rev": "799301991cd5dcea9b64245f9d500dcc76615653", + "rev": "57279532bc932b93df79d866b0663b1753cefda1", "type": "github" }, "original": { @@ -282,11 +282,11 @@ ] }, "locked": { - "lastModified": 1765384171, - "narHash": "sha256-FuFtkJrW1Z7u+3lhzPRau69E0CNjADku1mLQQflUORo=", + "lastModified": 1765605144, + "narHash": "sha256-RM2xs+1HdHxesjOelxoA3eSvXShC8pmBvtyTke4Ango=", "owner": "nix-community", "repo": "home-manager", - "rev": "44777152652bc9eacf8876976fa72cc77ca8b9d8", + "rev": "90b62096f099b73043a747348c11dbfcfbdea949", "type": "github" }, "original": { @@ -308,11 +308,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1765528203, - "narHash": "sha256-DTs3VkvRjW/Quu7y9hzNUrddysBXbcqv5Rpo4rtQYQI=", + "lastModified": 1765629179, + "narHash": "sha256-yYQR3ZYXWEh8mAQOhj6ZOZ4VxZrpzhRz14bOXAMPtcQ=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "8f74fd85c7b42f2d06347a9c9eaff6d4904854f3", + "rev": "46e723aa46565b67910187b4b7ad48b615d7f576", "type": "github" }, "original": { @@ -341,11 +341,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1765524373, - "narHash": "sha256-gi38XWhkb+H8iHhlXgv7MgUaQCuhmaTzKmq3yzYOg9g=", + "lastModified": 1765625997, + "narHash": "sha256-d0/ugnBSrCJwwySMc5skOMbAfEdjWapc+EMFbcsnd5Q=", "owner": "YaLTeR", "repo": "niri", - "rev": "c22d8358c293f5e66748d8ac20600e6b114f9743", + "rev": "d1fc1ab731f7cc59923a16acce9a387782bfeb10", "type": "github" }, "original": { @@ -379,11 +379,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1765505053, - "narHash": "sha256-nDMsy5cVXs4iShqoLt8gCz/s1LdVxsaUFsTuSY/22rg=", + "lastModified": 1765591065, + "narHash": "sha256-IdYRrUhfZHtAI3nOMKVeP0lsfZpaa/wHf2B8qD4VeOk=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "1778f178603ed65b4e4033c64f04ea51142ad6f6", + "rev": "ee90360c87fad52e8c34ef8b9ab3b52017c146a4", "type": "github" }, "original": { @@ -477,11 +477,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1765186076, - "narHash": "sha256-hM20uyap1a0M9d344I692r+ik4gTMyj60cQWO+hAYP8=", + "lastModified": 1765472234, + "narHash": "sha256-9VvC20PJPsleGMewwcWYKGzDIyjckEz8uWmT0vCDYK0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "addf7cf5f383a3101ecfba091b98d0a1263dc9b8", + "rev": "2fbfb1d73d239d2402a8fe03963e37aab15abe8b", "type": "github" }, "original": { @@ -531,11 +531,11 @@ ] }, "locked": { - "lastModified": 1765572306, - "narHash": "sha256-WqVMKEwdxC5LBRZMiKA9pxJ/vtKtl3HmdJzqMDd+1bg=", + "lastModified": 1765631331, + "narHash": "sha256-33kFCZlKPeKNt+T4MJbErNMIOdTSGAQjtnbQUPFbvOw=", "owner": "nix-community", "repo": "NUR", - "rev": "a038d2f292138ba982e1df3ce8e69a12570bd5d7", + "rev": "3efd2abcb60fe20da904182a480dfc1c840f417f", "type": "github" }, "original": { diff --git a/modules/desktop/dms/bar.nix b/modules/desktop/dms/bar.nix index 4c72bd8..33ef095 100644 --- a/modules/desktop/dms/bar.nix +++ b/modules/desktop/dms/bar.nix @@ -8,8 +8,8 @@ position = 0; spacing = 0; - innerPadding = 0; - bottomGap = -5; + innerPadding = -4; + bottomGap = -9; transparency = 0; widgetTransparency = 1; squareCorners = true; @@ -34,18 +34,28 @@ popupGapsManual = 4; maximizeDetection = true; }; + + primaryMonitor = builtins.head config.monitors; + primaryX = primaryMonitor.position.x or 0; + + # Partition secondary monitors into left and right based on their x position relative to primary + secondaryMonitors = builtins.tail config.monitors; + leftMonitors = builtins.filter (m: (m.position.x or 0) <= primaryX) secondaryMonitors; + rightMonitors = builtins.filter (m: (m.position.x or 0) > primaryX) secondaryMonitors; + primaryBar = { id = "default"; name = "Primary Bar"; screenPreferences = [ { - name = (builtins.head config.monitors).name or ""; + name = primaryMonitor.name or ""; } ]; showOnLastDisplay = true; leftWidgets = [ "launcherButton" + "clock" "workspaceSwitcher" "runningApps" ]; @@ -58,17 +68,33 @@ "cpuUsage" "controlCenterButton" "notificationButton" - "clock" ]; } // commonBarSettings; - secondaryBar = + + leftSecondaryBar = { - id = "secondary"; - name = "Secondary Bar"; + id = "secondary-left"; + name = "Secondary Bar (Left)"; screenPreferences = builtins.map (monitor: { inherit (monitor) name; - }) (builtins.tail config.monitors); + }) leftMonitors; + showOnLastDisplay = false; + leftWidgets = []; + centerWidgets = []; + rightWidgets = [ + "workspaceSwitcher" + ]; + } + // commonBarSettings; + + rightSecondaryBar = + { + id = "secondary-right"; + name = "Secondary Bar (Right)"; + screenPreferences = builtins.map (monitor: { + inherit (monitor) name; + }) rightMonitors; showOnLastDisplay = false; leftWidgets = [ "workspaceSwitcher" @@ -77,6 +103,11 @@ rightWidgets = []; } // commonBarSettings; + + # Only include secondary bars if they have monitors assigned + secondaryBars = + (lib.optional (leftMonitors != []) leftSecondaryBar) + ++ (lib.optional (rightMonitors != []) rightSecondaryBar); in { config = lib.mkIf config.fireproof.desktop.enable { fireproof.home-manager = { @@ -90,7 +121,7 @@ in { runningAppsCurrentWorkspace = true; runningAppsGroupByApp = true; - barConfigs = [primaryBar secondaryBar]; + barConfigs = [primaryBar] ++ secondaryBars; }; }; };