From aaca3bf66f197429544f0ce35b204475953bfb29 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Sat, 6 Nov 2021 21:33:05 +0100 Subject: [PATCH] nishimiya: Configure multihead --- hosts/nishimiya.nix | 26 ++++++++++++++++++++++++-- lib/helpers/kanshi.nix | 7 +++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/hosts/nishimiya.nix b/hosts/nishimiya.nix index 1edb280..b7c68ac 100644 --- a/hosts/nishimiya.nix +++ b/hosts/nishimiya.nix @@ -42,6 +42,8 @@ }; services = { kanshi = let + horizontal = "Samsung Electric Company C27F398 H4ZR101145"; + helpers = import ../lib/helpers/kanshi.nix; mkProfile = helpers.mkProfile; wallpaperScript = helpers.mkWallpaperScript { @@ -50,7 +52,7 @@ in { enable = true; profiles = { - home = mkProfile { + laptop = mkProfile { outputs = [ { criteria = "eDP-1"; @@ -59,9 +61,29 @@ position = "0,0"; } ]; - name = "home"; + name = "laptop"; script = wallpaperScript; }; + laptopHomeMultihead = mkProfile { + outputs = [ + { + criteria = horizontal; + status = "enable"; + mode = "1920x1080"; + position = "-1080,0"; + } + { + criteria = "eDP-1"; + status = "enable"; + mode = "1920x1080"; + position = "0,0"; + } + ]; + + name = "laptopHomeMultihead"; + script = wallpaperScript; + }; + # TODO: Generic multihead }; }; swaync.enable = true; diff --git a/lib/helpers/kanshi.nix b/lib/helpers/kanshi.nix index a908e43..ba932d0 100644 --- a/lib/helpers/kanshi.nix +++ b/lib/helpers/kanshi.nix @@ -24,6 +24,13 @@ setbg "DP-2" $horiz setbg "HDMI-A-3" $vert ;; + laptopHomeMultihead) + horiz1=$(random_file ${wallpapersHorizontal}) + horiz2=$(random_file ${wallpapersHorizontal}) + + setbg "eDP-1" $horiz1 + setbg "HDMI-A-1" $horiz2 + ;; genericMultihead) horiz1=$(random_file ${wallpapersHorizontal}) horiz2=$(random_file ${wallpapersHorizontal})