From ac626bcacd7c27d721172dbe982a5543343e3dac Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Sun, 24 Nov 2024 00:32:44 +0100 Subject: [PATCH] Add kanshi to autoconfigure monitor layout --- home/default.nix | 3 ++- home/{sway.nix => sway/default.nix} | 0 home/sway/kanshi.nix | 32 +++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) rename home/{sway.nix => sway/default.nix} (100%) create mode 100644 home/sway/kanshi.nix diff --git a/home/default.nix b/home/default.nix index 86c6b26..573873d 100644 --- a/home/default.nix +++ b/home/default.nix @@ -38,7 +38,8 @@ user: ./rofi.nix ./rust.nix ./signal.nix - ./sway.nix + ./sway/default.nix + ./sway/kanshi.nix ./telegram.nix ./thunderbird.nix ./tmux.nix diff --git a/home/sway.nix b/home/sway/default.nix similarity index 100% rename from home/sway.nix rename to home/sway/default.nix diff --git a/home/sway/kanshi.nix b/home/sway/kanshi.nix new file mode 100644 index 0000000..4534f21 --- /dev/null +++ b/home/sway/kanshi.nix @@ -0,0 +1,32 @@ +{ config, ... }: { + # automatically configure monitor layout depending on connected devices + # https://git.sr.ht/~emersion/kanshi + services.kanshi = { + enable = config.wayland.windowManager.sway.enable; + settings = [ + { + profile = { + name = "home"; + outputs = [ + { + criteria = "eDP-1"; + } + { + criteria = "HDMI-A-1"; + } + ]; + }; + } + { + profile = { + name = "mobile"; + outputs = [ + { + criteria = "eDP-1"; + } + ]; + }; + } + ]; + }; +}