Commit 0f78c9c19dd4

Vincent Demeester <vincent@sbr.pm>
2026-04-22 10:06:31
feat(okinawa): add kanshi profiles and dGPU udev rule
Added kanshi output profiles for HDMI docking and undocked modes on okinawa. Imported kanshi module into niri config. Added udev rule to keep dGPU awake for HDMI hotplug detection.
1 parent 3ebbb67
Changed files (3)
home
common
desktop
systems
home/common/desktop/niri/default.nix
@@ -1,6 +1,7 @@
 { pkgs, ... }:
 {
   imports = [
+    ../sway/kanshi.nix
     ../sway/mako.nix
     ../sway/swayidle.nix
     ../sway/rofi.nix
systems/okinawa/extra.nix
@@ -450,6 +450,12 @@
   # Prometheus node exporter (configured in common module)
   # Port and basic collectors already set in ../common/base (prometheus-exporters-node.nix)
 
+  # Keep dGPU (Navi 23 / RX 6700S) awake so HDMI hotplug is detected.
+  # The HDMI port is wired to the dGPU; runtime suspend prevents detection.
+  services.udev.extraRules = ''
+    ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x1002", ATTR{device}=="0x73ef", ATTR{power/control}="on"
+  '';
+
   # Lid handling: ignore (desktop replacement, mostly on AC)
   services.logind.settings.Login = {
     HandleLidSwitch = "ignore";
systems/okinawa/home.nix
@@ -32,6 +32,38 @@ in
     ../../home/common/shell/gh.nix
   ];
 
+  # Kanshi output profiles for okinawa (HDMI on dGPU)
+  services.kanshi.settings = [
+    {
+      profile.name = "okinawa-hdmi";
+      profile.outputs = [
+        {
+          criteria = "eDP-2";
+          status = "disable";
+        }
+        {
+          criteria = "LG Electronics LG ULTRAWIDE 0x0005D10C";
+          status = "enable";
+          position = "0,0";
+          mode = "3440x1440";
+          scale = 1.0;
+        }
+      ];
+    }
+    {
+      profile.name = "okinawa-undocked";
+      profile.outputs = [
+        {
+          criteria = "eDP-2";
+          status = "enable";
+          position = "0,0";
+          mode = "1920x1200";
+          scale = 1.0;
+        }
+      ];
+    }
+  ];
+
   # llama-cpp defaults for RX 6700S (RDNA2)
   # Flash attention crashes on gfx1030 ROCm: GGML_ASSERT(max_blocks_per_sm > 0)
   home.sessionVariables = {