From b66b7c543d35a28fa4c179ac95bde47589252784 Mon Sep 17 00:00:00 2001 From: Fabian Hauser Date: Mon, 8 Jul 2024 10:06:49 +0000 Subject: [PATCH] Update kanshi configuration --- home/fhauser/applications/kanshi.nix | 134 ++++++++------------------- 1 file changed, 41 insertions(+), 93 deletions(-) diff --git a/home/fhauser/applications/kanshi.nix b/home/fhauser/applications/kanshi.nix index a6b5e1f..5278fec 100644 --- a/home/fhauser/applications/kanshi.nix +++ b/home/fhauser/applications/kanshi.nix @@ -8,102 +8,50 @@ # systemd.user.services.kanshi.Install.WantedBy = "home-manager-fhauser.service"; # TODO: Upstream array type of systemdTarget services.kanshi = { enable = true; - profiles = + settings = let - backgroundPicturePath = "~/pictures/backgrounds"; + mkScreen = display: position: { + inherit (display.output) criteria; + inherit position; + }; + mkProfile = name: outputs: { + profile = { + inherit name outputs; + exec = backgroundCommand; + }; + }; + # Can be applied by profile.exec + backgroundPicturePath = "~/shares/cloud.qo.is/pictures/backgrounds"; backgroundCommand = '' - #swaymsg "output * bg `find ${backgroundPicturePath} -type f | shuf -n 1` fill" + swaymsg "output * bg `find ${backgroundPicturePath} -type f | shuf -n 1` fill" ''; - mkScreen = ( - screen: { - criteria = screen; - status = "enable"; - scale = 1.0; - } - ); - homeDellScreen = "Dell Inc. DELL P2720DC 22JPK53"; - p14sScreen = "BOE 0x08CE Unknown"; + + screens = { + x1-screen.output = { + criteria = "California Institute of Technology 0x1404 Unknown"; + scale = null; + }; + chur-4k.output = { + criteria = "HP Inc. HP Z27 CN482201RP"; + scale = 1.2; + }; + chur-dell.output = { + criteria = "Dell Inc. DELL P2720DC 22JPK53"; + scale = null; + }; + chur-small.output = { + criteria = "Eizo Nanao Corporation EV2450 92395086"; + scale = null; + }; + }; in - rec { - #mobile-work.exec = backgroundCommand; - mobile-work.outputs = [ - ( - mkScreen p14sScreen - // { - position = "0,0"; - scale = 2.0; - } - ) - ]; - mobile-work-external.outputs = [ - ( - mkScreen p14sScreen - // { - position = "1920,0"; - scale = 2.0; - } - ) - (mkScreen "Lenovo Group Limited M14 V907R2HD" // { position = "0,0"; }) - ]; - mobile-private.outputs = [ - ( - mkScreen "Unknown 0x1536 0x00000000" - // { - position = "0,0"; - scale = 1.5; - } - ) - ]; - home-dock.outputs = mobile-work.outputs ++ [ - ( - mkScreen homeDellScreen - // { - position = "1920,0"; - scale = 1.0; - status = "enable"; - } - ) - ]; - office-dock.outputs = [ - (mkScreen "Dell Inc. DELL P2720DC BRKPK53" // { position = "0,0"; }) - (mkScreen "Dell Inc. DELL P2720DC 6JRRK53" // { position = "2560,0"; }) - ( - mkScreen p14sScreen - // { - position = "5120,0"; - scale = 2.0; - } - ) - ]; - office-cyrille-dock.outputs = [ - ( - mkScreen "Acer Technologies Acer PE270K 0x0000B784" - // { - position = "0,0"; - scale = 1.5; - } - ) - ( - mkScreen p14sScreen - // { - position = "2560,0"; - scale = 2.0; - } - ) - ]; - home-pc.outputs = [ - (mkScreen homeDellScreen // { position = "0,0"; }) - ( - mkScreen "HP Inc. HP Z27 CN482201RP" - // { - position = "2560,0"; - scale = 1.5; - } - ) - ]; - home-pc-row.outputs = home-pc.outputs ++ [ - (mkScreen "Eizo Nanao Corporation EV2450 92395086" // { position = "5120,0"; }) - ]; - }; + with lib; + (attrValues screens) + ++ (with screens; [ + (mkProfile "home-dock" [ + (mkScreen x1-screen "0,120") + (mkScreen chur-4k "1920,0") + ]) + ]); }; }