Skip to content

feat: Linux/Wayland support#33

Open
nephalemsec wants to merge 8 commits intomainfrom
feat/linux-wayland-support
Open

feat: Linux/Wayland support#33
nephalemsec wants to merge 8 commits intomainfrom
feat/linux-wayland-support

Conversation

@nephalemsec
Copy link
Copy Markdown
Collaborator

Summary

Comprehensive Linux/Wayland support for Thoth, tested on NixOS + Hyprland with NVIDIA RTX 3080.

  • Recording indicator pill working on Hyprland via windowrulev2 rules (float, pin, noborder, size) with top-centre positioning via hyprctl
  • Sound feedback via canberra-gtk-play with freedesktop sound theme IDs
  • XDG Desktop Portal GlobalShortcuts backend for native Wayland hotkeys (replaces broken XWayland global-shortcut plugin)
  • Text insertion via wtype (Wayland) with wl-copy/wl-paste clipboard operations
  • Platform detection module (Wayland/X11, compositor identification)
  • Nix flake package with CUDA support, correct hashes, and runtime library wrapping
  • README updated with NixOS flake install instructions

Key changes

  • src-tauri/src/shortcuts/portal.rs — New XDG Portal GlobalShortcuts backend with Hyprland keybind bridge
  • src-tauri/src/platform/linux.rs — Wayland/X11 detection, compositor identification, GPU detection
  • src-tauri/src/recording_indicator.rs — Hyprland windowrulev2 integration for borderless pill indicator
  • src-tauri/src/text_insert.rs — wtype-based text insertion for Wayland
  • src-tauri/src/sound.rs — Linux sound feedback via canberra-gtk-play
  • flake.nix — Working nix build with CUDA, correct hashes, runtime wrapping

Test plan

  • App launches without crash on NixOS/Hyprland
  • CUDA GPU acceleration detected and used for transcription
  • Recording indicator pill displays correctly (no borders/dark rectangle)
  • Sound feedback plays on recording start and stop
  • Global shortcuts work via XDG Portal on Wayland
  • Text insertion works via wtype
  • nix build produces working package

…rtal shortcuts, text insertion

Comprehensive Linux/Wayland support including:

- Recording indicator pill working on Hyprland with windowrulev2 rules
  for float/pin/noborder/size, positioned at top-centre via hyprctl
- Sound feedback via canberra-gtk-play with freedesktop sound theme IDs
  (message-new-instant for start, message-sent-instant for stop)
- XDG Desktop Portal GlobalShortcuts backend for native Wayland hotkeys
- Text insertion via wtype (Wayland) with wl-copy/wl-paste clipboard ops
- Platform detection module (Wayland/X11, compositor identification)
- Pipeline events emitted directly to indicator window for reliable delivery
- CursorDot style auto-upgraded to Pill on Wayland (no mouse tracking)
- Audio capture improvements for Linux ALSA/PulseAudio compatibility
- Nix flake devshell with CUDA, system library, and tool dependencies
- Replace dummy cargoHash/pnpmDeps hashes with computed values
- Add fetcherVersion = 3 for fetchPnpmDeps API change
- Switch pnpm.fetchDeps to fetchPnpmDeps (non-deprecated)
- Fix deprecated xorg.* references to top-level libx11 etc
- Add git to nativeBuildInputs (whisper.cpp CMakeLists needs it)
- Track src-tauri/Cargo.lock in git (required for nix flake builds)
- Disable updater signing in nix sandbox via preBuild substituteInPlace
Also update README Linux section with NixOS flake install instructions
and mark Linux/Wayland support as shipped.
- Use buildFeatures/buildNoDefaultFeatures (not cargoBuild* variants)
  so cargo-tauri hook passes --features cuda to the build
- Link against CUDA stubs for libcuda.so in nix sandbox
- Wrap binary with LD_LIBRARY_PATH for cuda_cudart, libcublas,
  libappindicator, vulkan-loader, and /run/opengl-driver/lib
- Set WEBKIT_DISABLE_COMPOSITING_MODE=1 in wrapper for Wayland
@nephalemsec nephalemsec requested a review from poodle64 March 15, 2026 05:11
nephalemsec and others added 4 commits March 15, 2026 16:00
Ensures theme detection, sound feedback, and Hyprland keybind bridge
work when launched from app launchers (fuzzel) that don't inherit
the user's full shell PATH.
…──────────────────────�[0m

     �[38;5;238m│ �[0m�[1mSTDIN�[0m
�[38;5;238m─────┼──────────────────────────────────────────────────────────────────────────�[0m
�[38;5;238m   1�[0m �[38;5;238m│�[0m �[38;5;189mfix: Hyprland keybinds not working when launched from app launcher�[0m
�[38;5;238m   2�[0m �[38;5;238m│�[0m
�[38;5;238m   3�[0m �[38;5;238m│�[0m �[38;5;189mPortal signal delivery via D-Bus silently fails when launched from�[0m
�[38;5;238m   4�[0m �[38;5;238m│�[0m �[38;5;189mfuzzel/other app launchers (ashpd zbus connection dies). Replace the�[0m
�[38;5;238m   5�[0m �[38;5;238m│�[0m �[38;5;189mportal `global` dispatcher with Unix socket IPC — hyprctl `exec`�[0m
�[38;5;238m   6�[0m �[38;5;238m│�[0m �[38;5;189mwrites shortcut IDs to a socket that Thoth listens on directly.�[0m
�[38;5;238m   7�[0m �[38;5;238m│�[0m
�[38;5;238m   8�[0m �[38;5;238m│�[0m �[38;5;189m- Add socket listener for Hyprland shortcut IPC�[0m
�[38;5;238m   9�[0m �[38;5;238m│�[0m �[38;5;189m- Use `exec` dispatcher + socat instead of `global` dispatcher�[0m
�[38;5;238m  10�[0m �[38;5;238m│�[0m �[38;5;189m- Unbind stale hyprctl binds before rebinding�[0m
�[38;5;238m  11�[0m �[38;5;238m│�[0m �[38;5;189m- Resolve socat absolute nix store path at runtime�[0m
�[38;5;238m  12�[0m �[38;5;238m│�[0m �[38;5;189m- Add socat to nix wrapper PATH�[0m
�[38;5;238m─────┴──────────────────────────────────────────────────────────────────────────�[0m
- Reduce symlinks from 5 to 2 (rules/master, docs/master)
- Remove legacy symlinks (commands/master, hooks/master, skills/)
- Add/update settings.json with permissions + mimir plugin enablement
- Commands, skills, and hooks now come from the mimir plugin

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant