about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2021-02-13 04:04:40 +0100
committeraszlig <aszlig@nix.build>2021-02-13 04:40:38 +0100
commit6ee8541db0196536c935cd8c82dca1991240d38e (patch)
tree63402221b32d18a3d57108a2db80bd5527cd7f36 /tests
parentc7e86fadd27d30ebcf56cb311ce9661e5b244f2a (diff)
profiles/workstation: Add Flameshot
So far I've almost exclusively used scrot for screenshots, but most of
the time I used an image manipulation program to pixelate stuff, add
descriptions or draw arrows.

Flameshot combines this in a single application, so I expect that from
now on I can spam-post screenshots in even a higher rate than before ;-)

Signed-off-by: aszlig <aszlig@nix.build>
Diffstat (limited to 'tests')
-rw-r--r--tests/aszlig/programs/flameshot.nix26
-rw-r--r--tests/default.nix1
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/aszlig/programs/flameshot.nix b/tests/aszlig/programs/flameshot.nix
new file mode 100644
index 00000000..35e1d570
--- /dev/null
+++ b/tests/aszlig/programs/flameshot.nix
@@ -0,0 +1,26 @@
+{ nixpkgsPath, ... }:
+
+{
+  name = "flameshot";
+
+  machine = { 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;
+  };
+
+  enableOCR = true;
+
+  testScript = ''
+    # fmt: off
+    machine.wait_for_x()
+    machine.wait_for_file("/home/alice/.Xauthority")
+    machine.succeed("xauth merge ~alice/.Xauthority")
+    machine.succeed('su -c "DISPLAY=:0.0 flameshot gui" - alice &')
+    machine.wait_for_text('(?i)capture the screen')
+    machine.screenshot('flameshot')
+  '';
+}
diff --git a/tests/default.nix b/tests/default.nix
index edc022ad..e47ddd46 100644
--- a/tests/default.nix
+++ b/tests/default.nix
@@ -10,6 +10,7 @@ let
 
 in {
   aszlig.dnyarri.luks2-bcache = callTest ./aszlig/dnyarri/luks2-bcache.nix;
+  aszlig.programs.flameshot = callTest aszlig/programs/flameshot.nix;
   aszlig.programs.psi = callTest aszlig/programs/psi.nix;
   games = {
     starbound = callTest ./games/starbound.nix;