3 exampleText = "Lorem ipsum dolor sit amet";
6 name = "lomiri-docviewer-app-standalone";
7 meta.maintainers = lib.teams.lomiri.members;
10 { config, pkgs, ... }:
12 imports = [ ./common/x11.nix ];
14 services.xserver.enable = true;
17 etc."docviewer-sampletext.txt".text = exampleText;
21 libreoffice # txt -> odf to test LibreOfficeKit integration
23 ++ (with pkgs.lomiri; [
28 UITK_ICON_THEME = "suru";
32 i18n.supportedLocales = [ "all" ];
35 packages = with pkgs; [
36 # Intended font & helps with OCR
47 with subtest("lomiri docviewer launches"):
48 machine.succeed("lomiri-docviewer-app >&2 &")
49 machine.wait_for_text("No documents")
50 machine.screenshot("lomiri-docviewer_open")
52 machine.succeed("pkill -f lomiri-docviewer-app")
54 # Setup different document types
55 machine.succeed("soffice --convert-to odt --outdir /root/ /etc/docviewer-sampletext.txt")
56 machine.succeed("soffice --convert-to pdf --outdir /root/ /etc/docviewer-sampletext.txt")
58 with subtest("lomiri docviewer txt works"):
59 machine.succeed("lomiri-docviewer-app /etc/docviewer-sampletext.txt >&2 &")
60 machine.wait_for_text("${exampleText}")
61 machine.screenshot("lomiri-docviewer_txt")
63 machine.succeed("pkill -f lomiri-docviewer-app")
65 with subtest("lomiri docviewer odt works"):
66 machine.succeed("lomiri-docviewer-app /root/docviewer-sampletext.odt >&2 &")
67 machine.wait_for_text("${exampleText}")
68 machine.screenshot("lomiri-docviewer_odt")
70 machine.succeed("pkill -f lomiri-docviewer-app")
72 with subtest("lomiri docviewer pdf works"):
73 machine.succeed("lomiri-docviewer-app /root/docviewer-sampletext.pdf >&2 &")
74 machine.wait_for_text("${exampleText}")
75 machine.screenshot("lomiri-docviewer_pdf")
77 machine.succeed("pkill -f lomiri-docviewer-app")
79 with subtest("lomiri docviewer localisation works"):
80 machine.succeed("env LANG=de_DE.UTF-8 lomiri-docviewer-app >&2 &")
81 machine.wait_for_text("Keine Dokumente")
82 machine.screenshot("lomiri-docviewer_localised")