Back to Projects

Wayland AutoTyper

gnome-extension · dbus · automation

A native GNOME Shell extension acting as a secure D-Bus text injection bridge. Engineered to bypass screen-recording indicators and work flawlessly with XWayland/Electron apps.

Zero Screen Recording Dots

Standard tools like ydotool or wtype trigger the orange "Screen Recording" dot on your top panel. Wayland AutoTyper works completely silently without triggering any privacy indicators.

Session Token Security

Exports a secure D-Bus method that requires a dynamic 128-bit UUID token. The token is generated on startup with strict 0600 permissions, preventing sandboxed apps (Flatpaks/Snaps) from accessing it.

Smart Fallback Mode

Combines native GNOME Shell input commit with a clipboard + virtual Ctrl+V injection fallback. Works reliably across native Wayland, XWayland, and Electron apps (VSCode, Discord).

GTK4 Settings UI

Includes a native Libadwaita preferences window allowing you to customize the clipboard restoration delay (50ms - 5000ms) to fit your system speed.

Quick Integration Guide

To use this in your custom scripts (or dictation utilities like Handy), place the client script in your path and call it directly. It will automatically handle fetching the token and fallback paste logic.

# Paste current clipboard content securely:
autotype.sh

# Type custom text instantly:
autotype.sh "Hello from Wayland AutoTyper!"
org.gnome.Shell.Extensions.AutoTyper

How it works under the hood

// 1. Extension generates a session token on enable()
const token = GLib.uuid_string_random(); // e.g., 364bd8f2-08d7-4c2d...
GLib.file_set_contents("/run/user/1000/autotyper.token", token); // chmod 0600

// 2. Client script calls the exposed D-Bus method
gdbus call --session \
  --dest org.gnome.Shell \
  --object-path /org/gnome/Shell/Extensions/AutoTyper \
  --method org.gnome.Shell.Extensions.AutoTyper.TypeText "$TOKEN" "$TEXT"

// 3. Extension validates token & triggers synthetic event
if (token === this._token) {
  this._virtualDevice.notify_keyval(time, Clutter.KEY_Control_L, Pressed);
  this._virtualDevice.notify_keyval(time, Clutter.KEY_v, Pressed);
}

By hosting the virtual device directly inside the desktop compositor (Mutter), Wayland AutoTyper avoids the root-privilege requirements of uinput tools and ensures complete invisibility from global screen-grabbing alerts.