No description
Find a file
2023-08-16 18:40:39 +01:00
xkb xkb: use unsafe.Slice 2023-06-01 16:34:40 +01:00
.gitignore add .gitignore 2023-01-21 13:30:35 +00:00
80-dotool.rules overhaul to use xkbcommon 2023-04-21 11:25:08 +01:00
CHANGELOG.md version 1.3 2023-06-01 16:34:54 +01:00
dotool.go add --keyboard-name option 2023-08-16 18:40:39 +01:00
dotoolc minor usage formatting 2023-05-11 11:21:13 +01:00
dotoold add --keyboard-name option 2023-08-16 18:40:39 +01:00
go.mod use updated opt package 2022-12-28 10:43:19 +00:00
go.sum use updated opt package 2022-12-28 10:43:19 +00:00
install.sh install: add -buildvcs=false 2023-08-07 22:06:13 +01:00
keys.go always use xkb and complain if only variant is set 2023-05-11 11:21:13 +01:00
LICENSE initial commit 2022-10-22 13:41:10 +01:00
README.md minor usage formatting 2023-05-11 11:21:13 +01:00
uninstall.sh include udev rule and add uninstall.sh 2022-10-24 11:21:05 +01:00

dotool

dotool reads commands from stdin and simulates keyboard and pointer events. It works everywhere on Linux, including in X11, Wayland and TTYs.

Install From Source

With go and libxkbcommon-dev installed, run:

sudo ./install.sh

Permission

dotool requires permission to /dev/uinput to create the virtual input devices, and a udev rule grants this to users in group input.

You could try:

echo type hello | dotool

and if need be, you can run:

sudo groupadd -f input
sudo usermod -a -G input $USER

and re-login and trigger the udev rule or just reboot.

Usage

See dotool --help, but this greets the world:

echo 'type Sup, Lads!' | dotool

and this screams for three seconds:

{ echo keydown A; sleep 3; echo key H shift+1; } | dotool

There is an initial delay registering the virtual devices, but you can keep writing commands to the same instance or use the daemon and client, dotoold and dotoolc.

dotoold &
echo type super | dotoolc
echo type speedy | dotoolc

Keyboard Layouts

dotool will type gobbledygook if your environment has assigned it a different keyboard layout than it's simulating keycodes for. You can match them up with the environment variables DOTOOL_XKB_LAYOUT and DOTOOL_XKB_VARIANT.

echo type azerty | DOTOOL_XKB_LAYOUT=fr dotool

Numen and Contact

dotool was written for Numen, which has a chat on Matrix you're welcome to join.

You can also send questions, thoughts or patches by composing an email to ~geb/public-inbox@lists.sr.ht.

Support Me

Thank you!

License

GPLv3 only, see LICENSE.

Copyright (c) 2022-2023 John Gebbie