diff --git a/nixos/machines/strixi-minaj.nix b/nixos/machines/strixi-minaj.nix index 3e7efa09..d20157e3 100644 --- a/nixos/machines/strixi-minaj.nix +++ b/nixos/machines/strixi-minaj.nix @@ -101,6 +101,25 @@ home-manager.sharedModules = [ { + services.kanshi.settings = lib.mkBefore [ + { + profile.name = "internal-only"; + profile.outputs = [ + { + criteria = "eDP-1"; + status = "enable"; + mode = "2560x1600@240Hz"; + position = "0,0"; + scale = 1.0; + } + { + criteria = "Microstep MPG341CX OLED Unknown"; + status = "disable"; + } + ]; + } + ]; + home.stateVersion = "23.05"; } ]; diff --git a/nixos/patches/kanshi-sni-keep-menu-root-alive.patch b/nixos/patches/kanshi-sni-keep-menu-root-alive.patch new file mode 100644 index 00000000..b0edd6cd --- /dev/null +++ b/nixos/patches/kanshi-sni-keep-menu-root-alive.patch @@ -0,0 +1,26 @@ +--- a/src/Kanshi/SNI.hs ++++ b/src/Kanshi/SNI.hs +@@ -42,6 +42,7 @@ + data SNIState = SNIState + { sniConnection :: MVar (Maybe KanshiConnection) + , sniAppState :: MVar AppState ++ , sniMenuRoot :: MVar Dbusmenu.Menuitem + , sniMenuServer :: Dbusmenu.Server + , sniGLibContext :: GLib.MainContext + } +@@ -73,3 +74,5 @@ + appState <- buildInitialState kanshiConn + connVar <- newMVar kanshiConn + stateVar <- newMVar appState ++ initialRoot <- Dbusmenu.menuitemNew ++ rootVar <- newMVar initialRoot +@@ -76 +79 @@ +- let sniState = SNIState connVar stateVar menuServer context ++ let sniState = SNIState connVar stateVar rootVar menuServer context +@@ -168,6 +171,7 @@ + , onToggleMonitor = handleToggleMonitor sniState + } + newRoot <- buildMenu state actions ++ modifyMVar_ (sniMenuRoot sniState) $ const (pure newRoot) + runOnGLibMain (sniGLibContext sniState) $ + Dbusmenu.serverSetRoot (sniMenuServer sniState) newRoot diff --git a/nixos/sni.nix b/nixos/sni.nix index 5c648605..1b44eea3 100644 --- a/nixos/sni.nix +++ b/nixos/sni.nix @@ -5,6 +5,7 @@ let inputs.kanshi-sni.packages.${system}.default.overrideAttrs (old: { patches = (old.patches or [ ]) ++ [ ./patches/kanshi-sni-refresh-and-reconnect.patch + ./patches/kanshi-sni-keep-menu-root-alive.patch ]; }); in