nix-files/hosts/common/programs/wvkbd.nix
Colin 24a211bd3d sane-input-handler: remove keyboard launch fallback
it'll never work, because of sandboxing
2024-03-08 01:18:39 +00:00

54 lines
1.6 KiB
Nix

{ config, pkgs, ... }:
let
cfg = config.sane.programs.wvkbd;
in
{
sane.programs.wvkbd = {
packageUnwrapped = pkgs.wvkbd.overrideAttrs (base: {
postPatch = (base.postPatch or "") + ''
substituteInPlace layout.mobintl.h \
--replace-fail '#define KBD_KEY_BORDER 2' '#define KBD_KEY_BORDER 1'
'';
});
sandbox.method = "bwrap";
sandbox.whitelistWayland = true;
env.KEYBOARD = "wvkbd-mobintl";
services.wvkbd = {
description = "wvkbd: wayland virtual keyboard";
after = [ "graphical-session.target" ];
wantedBy = [ "graphical-session.target" ];
serviceConfig = {
# --hidden: send SIGUSR2 to unhide
ExecStart = "${cfg.package}/bin/wvkbd-mobintl --hidden";
Type = "simple";
Restart = "always";
RestartSec = "3s";
};
# wvkbd layers:
# - full
# - landscape
# - special (e.g. coding symbols like ~)
# - emoji
# - nav
# - simple (like landscape, but no parens/tab/etc; even fewer chars)
# - simplegrid (simple, but grid layout)
# - dialer (digits)
# - cyrillic
# - arabic
# - persian
# - greek
# - georgian
environment.WVKBD_LANDSCAPE_LAYERS = "landscape,special,emoji";
environment.WVKBD_LAYERS = "full,special,emoji";
environment.WVKBD_HEIGHT = "216"; #< default: 250 (pixels)
# environment.WVKBD_LANDSCAPE_HEIGHT = "??"; #< default: 120 (pixels)
# more settings tunable inside config.h when compiling:
# - KBD_KEY_BORDER = 2
};
};
}