sway: add 'xwayland disable' to sway config if disabled

Closes #2567
This commit is contained in:
Sumner Evans 2021-12-15 18:18:49 -07:00
parent c61fc1c288
commit 60527714d7
No known key found for this signature in database
GPG key ID: 8904527AB50022FD
13 changed files with 29 additions and 14 deletions

View file

@ -311,10 +311,10 @@ let
)}
''
else
"") + "\n" + (if cfg.systemdIntegration then ''
exec "systemctl --user import-environment; systemctl --user start sway-session.target"
'' else
"") + cfg.extraConfig);
"") + (concatStringsSep "\n" ((optional cfg.systemdIntegration ''
exec "systemctl --user import-environment; systemctl --user start sway-session.target"'')
++ (optional (!cfg.xwayland) "xwayland disable")
++ [ cfg.extraConfig ])));
defaultSwayPackage = pkgs.sway.override {
extraSessionCommands = cfg.extraSessionCommands;

View file

@ -5,6 +5,7 @@
sway-followmouse = ./sway-followmouse.nix;
sway-followmouse-legacy = ./sway-followmouse-legacy.nix;
sway-modules = ./sway-modules.nix;
sway-no-xwayland = ./sway-no-xwayland.nix;
sway-null-config = ./sway-null-config.nix;
sway-null-package = ./sway-null-package.nix;
sway-post-2003 = ./sway-post-2003.nix;

View file

@ -110,5 +110,4 @@ bar {
}
exec "systemctl --user import-environment; systemctl --user start sway-session.target"

View file

@ -110,5 +110,4 @@ bar {
}
exec "systemctl --user import-environment; systemctl --user start sway-session.target"

View file

@ -110,5 +110,4 @@ bar {
}
exec "systemctl --user import-environment; systemctl --user start sway-session.target"

View file

@ -83,5 +83,4 @@ bindsym k resize shrink height 10 px
bindsym l resize grow width 10 px
}
exec "systemctl --user import-environment; systemctl --user start sway-session.target"

View file

@ -83,5 +83,4 @@ bindsym k resize shrink height 10 px
bindsym l resize grow width 10 px
}
exec "systemctl --user import-environment; systemctl --user start sway-session.target"

View file

@ -122,5 +122,4 @@ bar {
}
exec "systemctl --user import-environment; systemctl --user start sway-session.target"

View file

@ -0,0 +1,23 @@
{ config, lib, pkgs, ... }:
{
imports = [ ./sway-stubs.nix ];
wayland.windowManager.sway = {
enable = true;
package = config.lib.test.mkStubPackage { outPath = "@sway@"; };
config = null;
systemdIntegration = false;
xwayland = false;
};
nmt.script = ''
assertFileExists home-files/.config/sway/config
assertFileContent home-files/.config/sway/config \
${
pkgs.writeText "expected" ''
xwayland disable
''
}
'';
}

View file

@ -13,6 +13,6 @@
nmt.script = ''
assertFileExists home-files/.config/sway/config
assertFileContent home-files/.config/sway/config \
${pkgs.writeText "expected" "\n"}
${pkgs.writeText "expected" ""}
'';
}

View file

@ -110,5 +110,4 @@ bar {
}
exec "systemctl --user import-environment; systemctl --user start sway-session.target"

View file

@ -109,5 +109,4 @@ bar {
}
exec "systemctl --user import-environment; systemctl --user start sway-session.target"

View file

@ -114,5 +114,4 @@ workspace "1" output eDP
workspace "ABC" output DP
workspace "3: Test" output HDMI
workspace "!"§$%&/(){}[]=?\*#<>-_.:,;²³" output DVI
exec "systemctl --user import-environment; systemctl --user start sway-session.target"