diff --git a/config/hypr/hyprland.lua b/config/hypr/hyprland.lua index 5bde4d0b56..4be47ed285 100644 --- a/config/hypr/hyprland.lua +++ b/config/hypr/hyprland.lua @@ -245,6 +245,12 @@ hl.bind( ) ) hl.bind("SUPER + R", hl.dsp.exec_cmd("pkill -SIGUSR1 waybar")) +-- On-screen keyboard (wvkbd): re-show after it hides itself; falls back +-- to launching it when it is not running at all. +hl.bind( + mainMod .. " + SHIFT + O", + hl.dsp.exec_cmd("pkill -USR2 wvkbd-mobintl || wvkbd-mobintl -L 500") +) hl.bind("SUPER_L", hl.dsp.exec_cmd("if [ -e /tmp/waybar_autotoggle ]; then pkill -SIGUSR1 waybar; fi")) hl.bind( "SUPER + SUPER_L", diff --git a/home/common/default.nix b/home/common/default.nix index 79f2f98cb2..2a1342913b 100644 --- a/home/common/default.nix +++ b/home/common/default.nix @@ -1752,6 +1752,11 @@ in with pkgs; [ libnotify + # On-screen keyboard (wvkbd-mobintl) for touch use over the + # Sunshine/Moonlight stream: launched only while a stream is + # live, by Sunshine's global_prep_cmd (nixos/hosts/amd-sunshine.nix); + # SUPER+SHIFT+O re-shows it (bind in config/hypr/hyprland.lua). + wvkbd # Atlas search CLI + service binary (pkgs/atlas-search); # step-6 cutover (#5356): the Rust binary is the resolved # `atlas-search` (the Python CLI is kept as atlas-search-py). diff --git a/nixos/hosts/amd-sunshine.nix b/nixos/hosts/amd-sunshine.nix index d4268456f5..aabfefe5df 100644 --- a/nixos/hosts/amd-sunshine.nix +++ b/nixos/hosts/amd-sunshine.nix @@ -79,6 +79,23 @@ let echo "OK: VAAPI hardware encoder confirmed in Sunshine's log." exit 0 ''; + # On-screen keyboard, stream-tied (Drew, 2026-11-08): Sunshine's + # global prep commands run these at stream start/stop, so wvkbd is + # on screen ONLY while a Moonlight stream is live — never at plain + # desktop login. The start script detaches wvkbd (setsid -f) and + # returns immediately: Sunshine waits for a prep command to exit + # before it starts streaming. pgrep guard keeps a second stream + # from stacking a second keyboard. + sunshine-wvkbd-start = pkgs.writeShellScriptBin "sunshine-wvkbd-start" '' + set -u + if ${pkgs.procps}/bin/pgrep -x wvkbd-mobintl >/dev/null 2>&1; then + exit 0 + fi + exec ${pkgs.util-linux}/bin/setsid -f ${pkgs.wvkbd}/bin/wvkbd-mobintl -L 500 + ''; + sunshine-wvkbd-stop = pkgs.writeShellScriptBin "sunshine-wvkbd-stop" '' + ${pkgs.procps}/bin/pkill -x wvkbd-mobintl || true + ''; in { services.sunshine = { @@ -101,6 +118,12 @@ in # fall through to software if VAAPI fails validation — which is # why the encoder check below exists and runs hourly). encoder = "vaapi"; + # Stream-tied on-screen keyboard (see the let block above): + # do at stream start, undo at stream stop. Rendered verbatim + # into sunshine.conf by the module's keyValue format, in the + # JSON shape this Sunshine build parses (key verified present + # in the pinned binary; prep_cmd_t in src/config.cpp upstream). + global_prep_cmd = "[{\"do\":\"sunshine-wvkbd-start\",\"undo\":\"sunshine-wvkbd-stop\",\"elevated\":false}]"; }; }; @@ -112,6 +135,8 @@ in # Project/ and is created interactively — see header. pkgs.moonlight-qt sunshine-encoder-check + sunshine-wvkbd-start + sunshine-wvkbd-stop ]; systemd.user.services.sunshine-encoder-check = {