mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
Localised strings still struggle to be found consistently. Issue seems to be that the app has a somewhat small horizontal max size, leaving more than half of the screen at the same colour as the app's text. Set IceWM's background colour to #FFFFFF to fix that discrepancy in background colours.
61 lines
1.8 KiB
Nix
61 lines
1.8 KiB
Nix
{ pkgs, lib, ... }:
|
|
{
|
|
name = "lomiri-clock-app-standalone";
|
|
meta.maintainers = lib.teams.lomiri.members;
|
|
|
|
nodes.machine =
|
|
{ config, pkgs, ... }:
|
|
{
|
|
imports = [ ./common/x11.nix ];
|
|
|
|
services.xserver.enable = true;
|
|
|
|
environment = {
|
|
systemPackages = with pkgs.lomiri; [
|
|
suru-icon-theme
|
|
lomiri-clock-app
|
|
];
|
|
variables = {
|
|
UITK_ICON_THEME = "suru";
|
|
};
|
|
|
|
# App has a somewhat small horizontal max size and a white background, while we configure IceWM to have a black background.
|
|
# Makes OCR less reliable, often completely fails to find the localised text. Force background to be white instead.
|
|
etc."icewm/prefoverride".text = ''
|
|
DesktopBackgroundColor=#FFFFFF
|
|
'';
|
|
};
|
|
|
|
i18n.supportedLocales = [ "all" ];
|
|
|
|
fonts.packages = with pkgs; [
|
|
# Intended font & helps with OCR
|
|
ubuntu-classic
|
|
];
|
|
};
|
|
|
|
enableOCR = true;
|
|
|
|
testScript = ''
|
|
machine.wait_for_x()
|
|
|
|
with subtest("lomiri clock launches"):
|
|
machine.succeed("lomiri-clock-app >&2 &")
|
|
machine.sleep(10)
|
|
machine.send_key("alt-f10")
|
|
machine.sleep(5)
|
|
machine.wait_for_text(r"(clock.ubports|City|Alarms|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday)")
|
|
machine.screenshot("lomiri-clock_open")
|
|
|
|
machine.succeed("pkill -f lomiri-clock-app")
|
|
|
|
with subtest("lomiri clock localisation works"):
|
|
machine.succeed("env LANG=de_DE.UTF-8 lomiri-clock-app >&2 &")
|
|
machine.sleep(10)
|
|
machine.send_key("alt-f10")
|
|
machine.sleep(5)
|
|
machine.wait_for_text(r"(Stadt|Weckzeiten|Montag|Dienstag|Mittwoch|Donnerstag|Freitag|Samstag|Sonntag)")
|
|
machine.screenshot("lomiri-clock_localised")
|
|
'';
|
|
}
|