From c997d14a43440e52fc4a4f0ebb073fd9ab9f9f12 Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 25 Mar 2024 15:05:26 +0100 Subject: tests/flameshot: Remove icewm background image The icewm start command has been changed[1] to be "icewm-session" a while ago, which not only starts the main icewm program but a bunch of related services, one of them being icewmbg. We're doing an OCR of the flameshot UI, which is layered over the screen with partial transparency, which in turn makes the OCR result pretty unreliable since now we have a background image. Since we're not testing icewm but flameshot, I decided to just use the "icewm" command we've used before, since we're not interested in all the auxiliary programs that form a full "icewm-session". This fixes the test since with the background image gone, OCR is new able to correctly pick up the text from the flameshot UI. [1]: https://github.com/NixOS/nixpkgs/commit/73cb33678527ddc323c7fcef3d17ac85603e5b02 Signed-off-by: aszlig --- tests/aszlig/programs/flameshot.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/aszlig/programs/flameshot.nix b/tests/aszlig/programs/flameshot.nix index 8dc5e33d..6f70d92a 100644 --- a/tests/aszlig/programs/flameshot.nix +++ b/tests/aszlig/programs/flameshot.nix @@ -3,13 +3,21 @@ { name = "flameshot"; - machine = { pkgs, ... }: { + machine = { lib, pkgs, ... }: { imports = [ "${nixpkgsPath}/nixos/tests/common/user-account.nix" "${nixpkgsPath}/nixos/tests/common/x11.nix" ]; test-support.displayManager.auto.user = "alice"; vuizvui.user.aszlig.programs.flameshot.enable = true; + + # Use "icewm" instead of "icewm-session" because the latter also starts + # icewmbg, which includes a default background image that is so noisy that + # we get bad OCR results. + services.xserver.windowManager.session = lib.mkForce (lib.singleton { + name = "icewm"; + start = "${pkgs.icewm}/bin/icewm & waitPID=$!"; + }); }; enableOCR = true; -- cgit 1.4.1