add on screen keyboard to lpt2
This commit is contained in:
parent
91cc33e87f
commit
c5b6c7a809
1 changed files with 447 additions and 409 deletions
|
|
@ -2,10 +2,12 @@
|
|||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
device,
|
||||
...
|
||||
}:
|
||||
{
|
||||
config = {
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
home.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
home.packages = with pkgs; [
|
||||
xwayland-satellite
|
||||
|
|
@ -433,5 +435,41 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
# lpt2's keyboard is flaky, so give it an on-screen keyboard.
|
||||
# squeekboard auto-shows on focused text fields via the input-method
|
||||
# protocol, but that doesn't catch every app, so Mod+K force-toggles it
|
||||
# over D-Bus (sm.puri.OSK0), which is squeekboard's own control interface.
|
||||
(
|
||||
let
|
||||
squeekboard-toggle = pkgs.writeShellApplication {
|
||||
name = "squeekboard-toggle";
|
||||
runtimeInputs = [ pkgs.systemd ];
|
||||
text = ''
|
||||
dest=sm.puri.OSK0
|
||||
path=/sm/puri/OSK0
|
||||
iface=sm.puri.OSK0
|
||||
current=$(busctl --user get-property "$dest" "$path" "$iface" Visible | cut -d' ' -f2)
|
||||
if [ "$current" = "true" ]; then
|
||||
busctl --user call "$dest" "$path" "$iface" SetVisible b false
|
||||
else
|
||||
busctl --user call "$dest" "$path" "$iface" SetVisible b true
|
||||
fi
|
||||
'';
|
||||
};
|
||||
in
|
||||
lib.mkIf (device == "muede-lpt2") {
|
||||
home.packages = [ pkgs.squeekboard ];
|
||||
|
||||
programs.niri.settings = {
|
||||
spawn-at-startup = [
|
||||
{ command = [ (lib.getExe' pkgs.squeekboard "squeekboard") ]; }
|
||||
];
|
||||
|
||||
binds."Mod+K".action.spawn = lib.getExe squeekboard-toggle;
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue