From e161cc2c932df2e61e1f6c460a5e1937708dfde8 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Sun, 14 Jan 2024 17:15:21 +0100 Subject: [PATCH] feat(kanshi): add home-office-left monitor config --- home-manager/sway/default.nix | 4 --- machines/p330/home-mandlm.nix | 68 ++++++++++++++++++++++++++++++----- machines/xps/home-mandlm.nix | 35 ++++++++++++++++++ 3 files changed, 94 insertions(+), 13 deletions(-) diff --git a/home-manager/sway/default.nix b/home-manager/sway/default.nix index a054229..9e3c9de 100644 --- a/home-manager/sway/default.nix +++ b/home-manager/sway/default.nix @@ -126,13 +126,9 @@ in startup = [ { command = "keepassxc"; } - { command = "swaymsg 'workspace 1"; } { command = "kitty"; } - { command = "swaymsg 'workspace 2"; } { command = "element-desktop"; } - { command = "swaymsg 'workspace 4"; } { command = "thunderbird"; } - { command = "swaymsg 'workspace 5"; } { command = "firefox"; } ]; }; diff --git a/machines/p330/home-mandlm.nix b/machines/p330/home-mandlm.nix index e4d1c2d..c4685cc 100644 --- a/machines/p330/home-mandlm.nix +++ b/machines/p330/home-mandlm.nix @@ -1,19 +1,69 @@ { config, lib, pkgs, user, ... }: { - wayland.windowManager.sway.config = { - output = { - DP-2 = { - scale = "1.5"; - position = "0 526"; + services.kanshi = { + enable = true; + + profiles = { + home_office_left = { + outputs = [ + { + criteria = "Samsung Electric Company U28E590 HTPJ404252"; + scale = 1.5; + status = "enable"; + position = "0,526"; + } + { + criteria = "Samsung Electric Company U28E590 HTPJ300612"; + scale = 1.5; + status = "enable"; + position = "2560,0"; + transform = "270"; + } + { + criteria = "eDP-1"; + status = "disable"; + } + ]; + exec = '' + exec swaymsg workspace 0, move workspace to output "Samsung Electric Company U28E590 HTPJ300612" + exec swaymsg workspace 8, move workspace to output "Samsung Electric Company U28E590 HTPJ300612" + exec swaymsg workspace 6, move workspace to output "Samsung Electric Company U28E590 HTPJ300612" + exec swaymsg workspace 4, move workspace to output "Samsung Electric Company U28E590 HTPJ300612" + exec swaymsg workspace 2, move workspace to output "Samsung Electric Company U28E590 HTPJ300612" + + exec swaymsg workspace 9, move workspace to output "Samsung Electric Company U28E590 HTPJ404252" + exec swaymsg workspace 7, move workspace to output "Samsung Electric Company U28E590 HTPJ404252" + exec swaymsg workspace 5, move workspace to output "Samsung Electric Company U28E590 HTPJ404252" + exec swaymsg workspace 3, move workspace to output "Samsung Electric Company U28E590 HTPJ404252" + exec swaymsg workspace 1, move workspace to output "Samsung Electric Company U28E590 HTPJ404252" + ''; }; - DP-3 = { - scale = "1.5"; - position = "2560 0"; - transform = "90"; + + home_office_right = { + outputs = [ + { + criteria = "Samsung Electric Company SMS24A450 H4MCA12730"; + scale = 1.0; + status = "enable"; + position = "0,0"; + } + { + criteria = "Samsung Electric Company SMS24A450 H4MCA12738"; + scale = 1.0; + status = "enable"; + position = "1920,0"; + } + { + criteria = "eDP-1"; + status = "disable"; + } + ]; }; }; + }; + wayland.windowManager.sway.config = { workspaceOutputAssign = [ { workspace = "0"; output = "DP-2"; } { workspace = "1"; output = "DP-3"; } diff --git a/machines/xps/home-mandlm.nix b/machines/xps/home-mandlm.nix index 8859ccc..da4fc61 100644 --- a/machines/xps/home-mandlm.nix +++ b/machines/xps/home-mandlm.nix @@ -15,6 +15,41 @@ ]; }; + home_office_left = { + outputs = [ + { + criteria = "Samsung Electric Company U28E590 HTPJ404252"; + scale = 1.5; + status = "enable"; + position = "0,526"; + } + { + criteria = "Samsung Electric Company U28E590 HTPJ300612"; + scale = 1.5; + status = "enable"; + position = "2560,0"; + transform = "270"; + } + { + criteria = "eDP-1"; + status = "disable"; + } + ]; + exec = '' + exec swaymsg workspace 0, move workspace to output "Samsung Electric Company U28E590 HTPJ300612" + exec swaymsg workspace 8, move workspace to output "Samsung Electric Company U28E590 HTPJ300612" + exec swaymsg workspace 6, move workspace to output "Samsung Electric Company U28E590 HTPJ300612" + exec swaymsg workspace 4, move workspace to output "Samsung Electric Company U28E590 HTPJ300612" + exec swaymsg workspace 2, move workspace to output "Samsung Electric Company U28E590 HTPJ300612" + + exec swaymsg workspace 9, move workspace to output "Samsung Electric Company U28E590 HTPJ404252" + exec swaymsg workspace 7, move workspace to output "Samsung Electric Company U28E590 HTPJ404252" + exec swaymsg workspace 5, move workspace to output "Samsung Electric Company U28E590 HTPJ404252" + exec swaymsg workspace 3, move workspace to output "Samsung Electric Company U28E590 HTPJ404252" + exec swaymsg workspace 1, move workspace to output "Samsung Electric Company U28E590 HTPJ404252" + ''; + }; + home_office_right = { outputs = [ {