From d1c3ec9b752b9028808494d0e84e63c32c37ce91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20K=C3=A4nner?= Date: Thu, 21 Aug 2025 14:08:58 +0200 Subject: [PATCH] add background for each output --- modules/home/sway/kanshi.nix | 316 +++++++++++------------------------ secrets/rclone.yaml | 6 +- 2 files changed, 101 insertions(+), 221 deletions(-) diff --git a/modules/home/sway/kanshi.nix b/modules/home/sway/kanshi.nix index 8d84a85..c697464 100644 --- a/modules/home/sway/kanshi.nix +++ b/modules/home/sway/kanshi.nix @@ -12,7 +12,40 @@ in { }; config = lib.mkIf cfg.enable { - services.kanshi = { + services.kanshi = let + bgdir = ../../../assets; + bg1080 = bgdir + "/bg1080.png"; + bg1080vert = bgdir + "/bg1080vert.png"; + bg4k = bgdir + "/bg4k.png"; + luhbots_workstation = settings: { + profile.outputs = [ + { + criteria = "eDP-1"; + position = if settings.vertical.left then "1080,1080" else "0,1080"; + } + { + criteria = settings.horizontal.name; + position = if settings.vertical.left then "1080,0" else "0,0"; + } + { + criteria = settings.vertical.name; + transform = settings.vertical.orientation; + position = if settings.vertical.left then "0,0" else "1920,0"; + } + ]; + profile.exec = [ + "${pkgs.sway}/bin/swaymsg 'workspace \"main\" output \"${settings.horizontal.name}\", workspace --no-auto-back-and-forth main, move workspace to \"${settings.horizontal.name}\", workspace back_and_forth'" + "${pkgs.sway}/bin/swaymsg 'workspace \"term\" output \"${settings.vertical.name}\", workspace --no-auto-back-and-forth term, move workspace to \"${settings.vertical.name}\", workspace back_and_forth'" + "${pkgs.sway}/bin/swaymsg 'workspace \"msg\" output eDP-1, workspace --no-auto-back-and-forth msg, move workspace to eDP-1, workspace back_and_forth'" + "${pkgs.sway}/bin/swaymsg 'workspace \"msg\" output eDP-1, workspace --no-auto-back-and-forth music, move workspace to eDP-1, workspace back_and_forth'" + "${pkgs.sway}/bin/swaymsg 'workspace \"5\" output \"${settings.horizontal.name}\", workspace --no-auto-back-and-forth 5, move workspace to \"${settings.horizontal.name}\", workspace back_and_forth'" + "${pkgs.sway}/bin/swaymsg 'output \"eDP-1\" bg ${bg1080} fit'" + "${pkgs.sway}/bin/swaymsg 'output \"${settings.horizontal.name}\" bg ${bg4k} fit'" + "${pkgs.sway}/bin/swaymsg 'output \"${settings.vertical.name}\" bg ${bg1080vert} fit'" + "${pkgs.sway}/bin/swaymsg 'workspace --no-auto-back-and-forth msg, workspace --no-auto-back-and-forth term, workspace --no-auto-back-and-forth main'" + ]; + }; + in { enable = true; settings = lib.mkIf cfg.laptop [ { @@ -24,223 +57,70 @@ in { } ]; } - { - profile.outputs = [ - { - criteria = "eDP-1"; - position = "0,1080"; - } - { - criteria = "Dell Inc. DELL U2422HE GRCPH83"; - position = "0,0"; - } - { - criteria = "NEC Corporation E243WMi 7X313185NB"; - transform = "90"; - position = "1920,0"; - } - ]; - profile.exec = [ - "${pkgs.sway}/bin/swaymsg workspace main; move workspace to DP-4; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace term; move workspace to DP-5; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace msg; move workspace to eDP-1; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace music; move workspace to eDP-1; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace 5; move workspace to DP-4; workspace back_and_forth" - ]; - } - { - profile.outputs = [ - { - criteria = "eDP-1"; - position = "0,1080"; - } - { - criteria = "Dell Inc. DELL U2422HE 8YCPH83"; - transform = "normal"; - position = "0,0"; - } - { - criteria = "Dell Inc. DELL P2422HE 28XL9M3"; - transform = "normal"; - position = "1920,0"; - } - ]; - profile.exec = [ - "${pkgs.sway}/bin/swaymsg workspace main; move workspace to '\"Dell Inc. DELL U2422HE 8YCPH83\"'; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace term; move workspace to '\"Dell Inc. DELL P2422HE 28XL9M3\"'; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace msg; move workspace to eDP-1; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace music; move workspace to eDP-1; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace 5; move workspace to '\"Dell Inc. DELL U2422HE 8YCPH83\"'; workspace back_and_forth" - ]; - } - { - profile.outputs = [ - { - criteria = "eDP-1"; - position = "0,1080"; - } - { - criteria = "Dell Inc. DELL U2422HE 53DCH83"; - position = "0,0"; - } - { - criteria = "Dell Inc. DELL U2412M 0FFXD46I4U5S"; - transform = "90"; - position = "1920,0"; - } - ]; - profile.exec = [ - "${pkgs.sway}/bin/swaymsg workspace main; move workspace to DP-6; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace term; move workspace to DP-7; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace msg; move workspace to eDP-1; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace music; move workspace to eDP-1; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace 5; move workspace to DP-6; workspace back_and_forth" - ]; - } - { - profile.outputs = [ - { - criteria = "eDP-1"; - position = "1080,1080"; - } - { - criteria = "Dell Inc. DELL P2422HE 4BXL9M3"; - position = "1080,0"; - } - { - criteria = "NEC Corporation E243WMi 75309334NB"; - transform = "90"; - position = "0,0"; - } - ]; - profile.exec = [ - "${pkgs.sway}/bin/swaymsg workspace main; move workspace to DP-3; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace term; move workspace to DP-4; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace msg; move workspace to eDP-1; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace music; move workspace to eDP-1; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace 5; move workspace to DP-3; workspace back_and_forth" - ]; - } - { - profile.outputs = [ - { - criteria = "eDP-1"; - position = "1080,1080"; - } - { - criteria = "Dell Inc. DELL P2422HE JLXL9M3"; - position = "1080,0"; - } - { - criteria = "NEC Corporation E243WMi 59118576NB"; - transform = "90"; - position = "0,0"; - } - ]; - profile.exec = [ - "${pkgs.sway}/bin/swaymsg workspace main; move workspace to DP-3; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace term; move workspace to DP-4; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace msg; move workspace to eDP-1; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace music; move workspace to eDP-1; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace 5; move workspace to DP-3; workspace back_and_forth" - ]; - } - { - profile.outputs = [ - { - criteria = "eDP-1"; - position = "0,1080"; - } - { - criteria = "Dell Inc. DELL P2422HE 7VWL9M3"; - position = "0,0"; - } - { - criteria = "ViewSonic Corporation VG2448 V5E201960167"; - transform = "90"; - position = "1920,0"; - } - ]; - profile.exec = [ - "${pkgs.sway}/bin/swaymsg workspace main; move workspace to '\"Dell Inc. DELL P2422HE 7VWL9M3\"'; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace term; move workspace to '\"ViewSonic Corporation VG2448 V5E201960167\"'; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace msg; move workspace to eDP-1; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace music; move workspace to eDP-1; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace 5; move workspace to '\"Dell Inc. DELL P2422HE 7VWL9M3\"'; workspace back_and_forth" - ]; - } - { - profile.outputs = [ - { - criteria = "eDP-1"; - position = "1080,1080"; - } - { - criteria = "Dell Inc. DELL U2422HE 7HCPH83"; - position = "1080,0"; - } - { - criteria = "Dell Inc. DELL U2422HE 1XFFH83"; - transform = "90"; - position = "0,0"; - } - ]; - profile.exec = [ - "${pkgs.sway}/bin/swaymsg workspace main; move workspace to '\"Dell Inc. DELL U2422HE 7HCPH83\"'; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace term; move workspace to '\"Dell Inc. DELL U2422HE 1XFFH83\"'; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace msg; move workspace to eDP-1; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace music; move workspace to eDP-1; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace 5; move workspace to '\"Dell Inc. DELL U2422HE 7HCPH83\"'; workspace back_and_forth" - ]; - } - { - profile.outputs = [ - { - criteria = "eDP-1"; - position = "1080,1080"; - } - { - criteria = "Dell Inc. DELL U2422HE 5XY5H83"; - position = "1080,0"; - } - { - criteria = "Dell Inc. DELL U2419H 11B7Y13"; - transform = "270"; - position = "0,0"; - } - ]; - profile.exec = [ - "${pkgs.sway}/bin/swaymsg workspace main; move workspace to '\"Dell Inc. DELL U2422HE 5XY5H83\"'; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace term; move workspace to '\"Dell Inc. DELL U2419H 11B7Y13\"'; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace msg; move workspace to eDP-1; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace music; move workspace to eDP-1; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace 5; move workspace to '\"Dell Inc. DELL U2422HE 5XY5H83\"'; workspace back_and_forth" - ]; - } - { - profile.outputs = [ - { - criteria = "eDP-1"; - position = "1080,1080"; - } - { - criteria = "DP-3"; - position = "1080,0"; - } - { - criteria = "DP-1"; - transform = "90"; - position = "0,0"; - } - ]; - profile.exec = [ - "${pkgs.sway}/bin/swaymsg workspace main; move workspace to DP-3; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace term; move workspace to DP-1; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace msg; move workspace to eDP-1; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace music; move workspace to eDP-1; workspace back_and_forth" - "${pkgs.sway}/bin/swaymsg workspace 5; move workspace to DP-3; workspace back_and_forth" - ]; - } + (luhbots_workstation { + horizontal.name = "Dell Inc. DELL U2422HE GRCPH83"; + vertical = { + name = "NEC Corporation E243WMi 7X313185NB"; + left = false; + orientation = "90"; + }; + }) + (luhbots_workstation { + horizontal.name = "Dell Inc. DELL U2422HE 8YCPH83"; + vertical = { + name = "Dell Inc. DELL P2422HE 28XL9M3"; + left = false; + orientation = "normal"; + }; + }) + (luhbots_workstation { + horizontal.name = "Dell Inc. DELL U2422HE 53DCH83"; + vertical = { + name = "Dell Inc. DELL U2412M 0FFXD46I4U5S"; + left = false; + orientation = "90"; + }; + }) + (luhbots_workstation { + horizontal.name = "Dell Inc. DELL P2422HE 4BXL9M"; + vertical = { + name = "NEC Corporation E243WMi 75309334NB"; + left = true; + orientation = "90"; + }; + }) + (luhbots_workstation { + horizontal.name = "Dell Inc. DELL P2422HE JLXL9M3"; + vertical = { + name = "NEC Corporation E243WMi 59118576NB"; + left = true; + orientation = "90"; + }; + }) + (luhbots_workstation { + horizontal.name = "Dell Inc. DELL P2422HE 7VWL9M3"; + vertical = { + name = "ViewSonic Corporation VG2448 V5E201960167"; + left = false; + orientation = "90"; + }; + }) + (luhbots_workstation { + horizontal.name = "Dell Inc. DELL U2422HE 7HCPH83"; + vertical = { + name = "Dell Inc. DELL U2422HE 1XFFH83"; + left = true; + orientation = "90"; + }; + }) + (luhbots_workstation { + horizontal.name = "Dell Inc. DELL U2422HE 5XY5H83"; + vertical = { + name = "Dell Inc. DELL U2419H 11B7Y13"; + left = true; + orientation = "270"; + }; + }) { profile.name = "docked-4k"; profile.outputs = [ diff --git a/secrets/rclone.yaml b/secrets/rclone.yaml index 2933745..3600a89 100644 --- a/secrets/rclone.yaml +++ b/secrets/rclone.yaml @@ -1,7 +1,7 @@ cloud: url: ENC[AES256_GCM,data:BoSdQrtLNKYpaHIWUj5Ak8PGMJz3hj/z88XVBgN6AbyT2K/bC412p3oi+X9MmYATR3A=,iv:wez+v5kEN+niZmZXzaJoygHf4mqKVI6CINktAZe8WTs=,tag:20W87Kcn94smiLtX9mMdOw==,type:str] user: ENC[AES256_GCM,data:kFza,iv:OrDNF/h+xLuuyq2cpaHnQuRM1lwuXhe8Ue0rm/wRmkY=,tag:9t+hEx38r/yBIzWIFD0GnQ==,type:str] - pass: ENC[AES256_GCM,data:08OVCCBRmYY6bfRLSLu1lLNybs3cuCYNvFM2cLUMODMTgkVNJt/0Ko9kTlqi74t+yJtdexQJHnNN9kHU,iv:wXp/dz8Qi0npRR52EmNQDE4ENhqJAXLDMGB4fr7V+Ck=,tag:XedJlS92WbZGezgXfaDHGA==,type:str] + pass: ENC[AES256_GCM,data:Li7KW31pcwL0rq/Ottz+A6fjusX+Msay4dLkM1DAEsRp1cb6nqauD51pWIkGqntZtC6Z3U3sOpY73Wo5,iv:zI3z1dlCBn/s5EquH18ILTUg0YuMBnQKUCgNkTKJY8o=,tag:sKzadnNXwf1kMFlhK56+jA==,type:str] luhbots: url: ENC[AES256_GCM,data:5hnCSyNcr3un83FaNGYaiZdbxCJe87+hzpoRtWozbn0OW31pxONIEQnSikXh59/OlVJN9TEmv+bd3uO210NPoKUL0D2MWw==,iv:fvY7fLbiAVGq0hh4ifs/LRgixlZsIDczw0hpiUvFSw0=,tag:gXNgNWMDXnRMdyhTjnG6oA==,type:str] user: ENC[AES256_GCM,data:ucJ21fRmDKvHtyA=,iv:IYfNwBBWYxVb7ptwhfBiBgXwaoj5oCWg6gCI3WD8sjE=,tag:sB6/PJuquUL/GugpfzNMRw==,type:str] @@ -17,7 +17,7 @@ sops: cVV3dFpNbjY1bkZtUlltanpSNDlPd28KQ4FQrC6KyZEzzkmByh07q1RAGnWnCNtr XTDQhlbSq/LdptpqNbUD2g9H9vC2CAC0av39ExvT55JiK4dEWmrwUA== -----END AGE ENCRYPTED FILE----- - lastmodified: "2025-08-07T10:39:21Z" - mac: ENC[AES256_GCM,data:7rZ0z+V1DDx78BCOolzw+IkzO+Cm5CKfzuvFBT5t7t6Q9W6Qz5aV/DbNYZjn4LLPHRx7AepvmDgVzEYAIPME0jtvWUTWomWCS8BsKxXBQsUXaKUkqEJqo6hw0irhrHi+/8ZGtQgMQsL1H3mFTRDTt4UXyk5XYvttxx6IvXCxChE=,iv:x7IJ7CViWv0cd5/zWH9e34TWQO0gnFlHKvoVDwLzDTY=,tag:p1Tg9ub8w0UOiEB7qfztbw==,type:str] + lastmodified: "2025-08-21T11:59:42Z" + mac: ENC[AES256_GCM,data:AjDUc3G435FGlZysR+84u+SXeeou9HzTvGnZjEXZbS+AaHEv3CEXPG0qSUbyzudbF3G8oFTgMzlQlZ2ayTJKCNjzn9cgbo1K9iUfphkMD7vrPaIiB7y6GYaA6HRVdUvGNM7kwrH/HpkzgvVP96ey3jb0ZYd4g7sbaGPwDdsd7vk=,iv:u5UrX9QpycSpQ9DKnAtGr3PJ28GEKIagggdZ9ZpWsKw=,tag:911biSbujzMmlTP/5KWw+Q==,type:str] unencrypted_suffix: _unencrypted version: 3.10.2