+
Skip to content

r0chd/whydotool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

whydotool

A Wayland-native command-line automation tool.

Inspired by ydotool, it simulates keyboard and mouse input using native Wayland protocols, no root privileges, no daemons, no kernel hacks.

Features

  • click - simulate mouse button presses
  • mousemove - Move the pointer (relative or absolute)
  • type - type strings of text
  • key- press and release individual keys
  • stdin - stream key events from standard input in real time
  • no root required
  • no daemon required

Requirements

whydotool works on most major Wayland compositors via either:

  • Native Wayland protocols

  • xdg-desktop-portal RemoteDesktop interface

Protocol Support

Keyboard input (key, type, stdin):

Pointer input (click, mousemove):

Universal alternative: If your compositor doesn’t support the above protocols, whydotool can use the xdg-desktop-portal RemoteDesktop interface. See the list of supported backends

If your compositor doesn't support the specific protocols above, it will likely work through the portal interface. Check the linked compatibility tables to verify support for your compositor.

Optional Features

portals (disabled by default)

The portals backend enables input injection via the xdg-desktop-portal RemoteDesktop interface. This is useful if your compositor doesn’t support the native virtual input protocols, like GNOME, which supports neither, or KDE Plasma, which lacks the virtual-keyboard protocol.

Build with:

cargo build --features portals

enabling portal drags in a bunch of heavy dependencies such as zbus and PipeWire, which significantly increases the final binary size and compilation times.

Examples

Type text:

whydotool type "Hello Wayland"

Press a key:

whydotool key 56:1 62:1 62:0 56:0

Relatively move mouse pointer by -100,100:

whydotool mousemove -x -100 -y 100

Move mouse pointer to 100,100:

whydotool mousemove --absolute -x 100 -y 100

Mouse right click:

whydotool click 0xC1

Mouse repeating left click:

whydotool click --repeat 5 --next-delay 25 0xC0

whydotool vs. ydotool

Feature whydotool ydotool
Compatibility Wayland only Runs everywhere
Security Model Uses compositor-granted Wayland protocols or xdg-desktop-portal Writes directly to uinput
Privileges Does not require root Requires root privileges
Daemon Daemonless Requires a running daemon

About

Wayland-native command-line automation tool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载