Skip to content

Conversation

@johnpyp
Copy link

@johnpyp johnpyp commented Oct 31, 2025

This PR adds:

  • support for sending SIGUSR2 to handy to toggle recording on and off,
  • adds the wayland feature to enigo
    • this allows enigo to use the wayland input method protocol, which is supported by most wayland compositors.
    • with this feature enabled, enigo will still attempt to write to all its possible input methods, so this won't conflict with X11.

Example usage of SIGUSR2 (Sway config):

bindsym $mod+o exec pkill -USR2 -n handy

Now, whenever I press alt+o, it'll toggle on, and I press it again, it toggles off. Easy.

(pkill is used here but it doesn't actually "kill" anything. It's just sending that signal to the process matching the name "handy", which we handle!)

Complications

Enabling the wayland feature on enigo seems to affect the overlay monitor detection (only inside of wayland). Just using X11 detection actually works (at least in Sway), but by using the wayland detection, enigo instead early-errors out with:

[2025-10-31T19:06:33Z ERROR enigo::platform::wayland] You tried to get the mouse location. I don't know how this is possible under Wayland. Let me know if there is a new protocol

This seems like an upstream bug which needs to be fixed to properly gracefully fallback.

@johnpyp johnpyp changed the title feat: SIGUSR2 handling for toggles feat: SIGUSR2 handling for toggles, wayland enigo feature Oct 31, 2025
@cjpais
Copy link
Owner

cjpais commented Oct 31, 2025

Hey thank you so much! How much have you tested this? I don't have a Linux machine currently so I won't be able to test but would love to pull this in

@johnpyp
Copy link
Author

johnpyp commented Oct 31, 2025

So far I've tested with tauri dev only, on Wayland.

I can try a prod build, and verify that it doesn't regress behavior on X11?

@cjpais
Copy link
Owner

cjpais commented Oct 31, 2025

That would be great! And if you do get one could you post it here and also in the discord?

This thread had some stuff for Wayland debug: https://discord.com/channels/1391636091853078608/1432847242766716989

Also if time can you evaluate the impact relative to this PR as well? I want to merge it soon just haven't had time to review the code carefully

#265

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.

2 participants