From 5b3e6d859bc76244ec69537ee1a376cdc29c2217 Mon Sep 17 00:00:00 2001 From: fleaz Date: Tue, 18 Feb 2025 22:16:22 +0100 Subject: [PATCH] sway: Finally get my multi-monitor setup fixed --- home-manager/modules/kanshi.nix | 36 +++++++++++++---------- home-manager/modules/sway.nix | 52 ++++++++++++++++----------------- 2 files changed, 47 insertions(+), 41 deletions(-) diff --git a/home-manager/modules/kanshi.nix b/home-manager/modules/kanshi.nix index 2c07b36..e0d7c7c 100644 --- a/home-manager/modules/kanshi.nix +++ b/home-manager/modules/kanshi.nix @@ -1,15 +1,18 @@ { nixosConfig, ... }: let machines = { - smithers = [{ - profile.name = "laptop-only"; - profile.outputs = [ - { - criteria = "eDP-1"; - scale = 1.3; - } - ]; - } + smithers = [ + { + profile.name = "laptop-only"; + profile.outputs = [ + { + criteria = "eDP-1"; + status = "enable"; + scale = 1.3; + mode = "2256x1504@59.999Hz"; + } + ]; + } { profile.name = "homeoffice"; profile.outputs = [ @@ -18,17 +21,20 @@ let status = "disable"; } { - criteria = "DP-10"; - scale = 1.3; + criteria = "Samsung Electric Company U28E590 HTPJ109320"; + scale = 1.4; position = "0,0"; + mode = "3840x2160@60.000Hz"; } { - criteria = "DP-9"; - scale = 1.3; - position = "2952,0"; + criteria = "Samsung Electric Company U28E590 HTPM402579"; + scale = 1.4; + position = "2743,0"; + mode = "3840x2160@60.000Hz"; } ]; - }]; + } + ]; }; in { diff --git a/home-manager/modules/sway.nix b/home-manager/modules/sway.nix index 6318966..4678a17 100644 --- a/home-manager/modules/sway.nix +++ b/home-manager/modules/sway.nix @@ -16,36 +16,36 @@ in focus.followMouse = false; input = { - "type:keyboard" = { xkb_layout = "eu"; }; - "type:mouse" = { pointer_accel = "-1"; }; - "type:touchpad" = { tap = "enabled"; }; - "1:1:AT_Translated_Set_2_keyboard" = { - # Remap borken ctrl key on internal keyboard for XPS - xkb_options = "caps:ctrl_modifier"; + "type:keyboard" = { + xkb_layout = "eu"; + }; + "type:mouse" = { + pointer_accel = "-1"; + }; + "type:touchpad" = { + tap = "enabled"; }; }; - output = { - "*".bg = "/etc/nixos/wallpaper.jpg fill"; - } // lib.optionalAttrs (nixosConfig.networking.hostName == "cray") { - "DP-1" = { - mode = "3840x2160"; - scale = "1.3"; - position = "0,0"; + output = + { + "*".bg = "/etc/nixos/wallpaper.jpg fill"; + } + // lib.optionalAttrs (nixosConfig.networking.hostName == "cray") { + "DP-1" = { + mode = "3840x2160"; + scale = "1.3"; + position = "0,0"; + }; + "DP-3" = { + mode = "3840x2160"; + scale = "1.3"; + position = "2953,0"; + }; }; - "DP-3" = { - mode = "3840x2160"; - scale = "1.3"; - position = "2953,0"; - }; - } // lib.optionalAttrs (nixosConfig.networking.hostName == "smithers") { - "eDP-1" = { - mode = "2256x1504"; - scale = "1.2"; - position = "0,0"; - }; - }; - gaps = { inner = 5; }; + gaps = { + inner = 5; + }; window.border = 2; window.hideEdgeBorders = "smart"; workspaceAutoBackAndForth = true;