diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2023-04-06 02:54:37 +0200 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2023-04-06 04:19:08 +0200 |
commit | 98d2e797e8f879a3ac7f608eac9c4c08181d874c (patch) | |
tree | 6c2393b285c665bb75338d5b2ad80f649c1bb453 /nixos/tests/gnome-xorg.nix | |
parent | 1a7671c70462370ad0b7f7c1b81ba8a9e001b52f (diff) |
nixos/tests/gnome: Do not use autostart and switch to kgx
Starting terminal with autostart makes it harder to control when it is activated. This reverts commit 7aaf5262258a4c2e7366510d0978050f0ed965c4. Unfortunately, we cannot simply just go back since that would fail as mentioned in the reverted commit. It appears that this is due to the app not being able to find DISPLAY, since switching to a different terminal emulator will complain: (kgx:1612): Gtk-WARNING **: 01:12:49.988: cannot open display: :0.0 Let’s use D-Bus activation rather than executing the program through su. That will hopefully take care of all the necessary environment variables. And since GNOME Terminal does not support D-Bus activation for the app, let’s switch to GNOME Console. It probably makes sense anyway, as it is the default terminal emulator. Also let’s unify the WMClass detection a bit. Though, weirdly, the WMClass differs on Wayland.
Diffstat (limited to 'nixos/tests/gnome-xorg.nix')
-rw-r--r-- | nixos/tests/gnome-xorg.nix | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/nixos/tests/gnome-xorg.nix b/nixos/tests/gnome-xorg.nix index 618458b1f6b5b..f520a01238309 100644 --- a/nixos/tests/gnome-xorg.nix +++ b/nixos/tests/gnome-xorg.nix @@ -24,7 +24,6 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : { services.xserver.desktopManager.gnome.enable = true; services.xserver.desktopManager.gnome.debug = true; services.xserver.displayManager.defaultSession = "gnome-xorg"; - programs.gnome-terminal.enable = true; systemd.user.services = { "org.gnome.Shell@x11" = { @@ -61,10 +60,10 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : { # False when startup is done startingUp = su "${gdbus} ${eval} Main.layoutManager._startingUp"; - # Start gnome-terminal - gnomeTerminalCommand = su "gnome-terminal"; + # Start Console + launchConsole = su "${bus} gapplication launch org.gnome.Console"; - # Hopefully gnome-terminal's wm class + # Hopefully Console's wm class wmClass = su "${gdbus} ${eval} global.display.focus_window.wm_class"; in '' with subtest("Login to GNOME Xorg with GDM"): @@ -82,13 +81,14 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : { "${startingUp} | grep -q 'true,..false'" ) - with subtest("Open Gnome Terminal"): + with subtest("Open Console"): machine.succeed( - "${gnomeTerminalCommand}" + "${launchConsole}" ) - # correct output should be (true, '"Gnome-terminal"') + # correct output should be (true, '"kgx"') + # For some reason, this deviates from Wayland. machine.wait_until_succeeds( - "${wmClass} | grep -q 'true,...Gnome-terminal'" + "${wmClass} | grep -q 'true,...kgx'" ) machine.sleep(20) machine.screenshot("screen") |