about summary refs log tree commit diff
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2024-03-25 15:05:26 +0100
committeraszlig <aszlig@nix.build>2024-03-25 15:05:26 +0100
commitc997d14a43440e52fc4a4f0ebb073fd9ab9f9f12 (patch)
treefc41d84c4ac01291a2ea1345824f08d444d1a14d
parent2cf463b899b1622ca0cb747a7a9e140554a0365c (diff)
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 <aszlig@nix.build>
-rw-r--r--tests/aszlig/programs/flameshot.nix10
1 files changed, 9 insertions, 1 deletions
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;