minor usage formatting

This commit is contained in:
John Gebbie 2023-05-11 11:16:22 +01:00
parent 1b330dd7c1
commit 41268e1ece
4 changed files with 38 additions and 43 deletions

View file

@ -45,10 +45,9 @@ keep writing commands to the same instance or use the daemon and client,
## Keyboard Layouts ## Keyboard Layouts
dotool will produce gobbledygook if your environment has assigned it a dotool will type gobbledygook if your environment has assigned it a different
different keyboard layout than it's simulating keycodes for. You can keyboard layout than it's simulating keycodes for. You can match them up
match them up with the environment variables `DOTOOL_XKB_LAYOUT` and with the environment variables `DOTOOL_XKB_LAYOUT` and `DOTOOL_XKB_VARIANT`.
`DOTOOL_XKB_VARIANT`.
echo type azerty | DOTOOL_XKB_LAYOUT=fr dotool echo type azerty | DOTOOL_XKB_LAYOUT=fr dotool

View file

@ -21,21 +21,21 @@ func usage() {
fmt.Println(`dotool reads commands from stdin and simulates keyboard and pointer events. fmt.Println(`dotool reads commands from stdin and simulates keyboard and pointer events.
The commands are: The commands are:
key CHORD... key CHORD...
keydown CHORD... keydown CHORD...
keyup CHORD... keyup CHORD...
type TEXT type TEXT
click left/middle/right click left/middle/right
buttondown left/middle/right buttondown left/middle/right
buttonup left/middle/right buttonup left/middle/right
wheel AMOUNT (a positive AMOUNT is up, a negative is down) wheel AMOUNT (a positive AMOUNT is up, a negative is down)
hwheel AMOUNT (a positive AMOUNT is right, a negative is left) hwheel AMOUNT (a positive AMOUNT is right, a negative is left)
mouseto X Y (where X and Y are percentages between 0.0 and 1.0) mouseto X Y (where X and Y are percentages between 0.0 and 1.0)
mousemove X Y (where X and Y are the number of pixels to move) mousemove X Y (where X and Y are the number of pixels to move)
keydelay MILLISECONDS (default: 2) keydelay MILLISECONDS (default: 2)
keyhold MILLISECONDS (default: 8) keyhold MILLISECONDS (default: 8)
typedelay MILLISECONDS (default: 2) typedelay MILLISECONDS (default: 2)
typehold MILLISECONDS (default: 8) typehold MILLISECONDS (default: 8)
dotool is installed with a udev rule to allow users in group input to run dotool is installed with a udev rule to allow users in group input to run
@ -43,8 +43,8 @@ it without root permissions.
You can add yourself to group input by running: You can add yourself to group input by running:
sudo groupadd -f input sudo groupadd -f input
sudo usermod -a -G input $USER sudo usermod -a -G input $USER
It's foolproof to reboot to make the rule effective. It's foolproof to reboot to make the rule effective.
@ -55,37 +55,35 @@ uppercase character keys also simulate shift.
The modifiers are: super, ctrl, alt and shift. The modifiers are: super, ctrl, alt and shift.
echo key shift+1 x:exclam shift+k:2 | dotool echo key shift+1 x:exclam shift+k:2 | dotool
There is an initial delay registering the virtual devices, but you can keep 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 writing commands to the same instance or use the daemon and client, dotoold
and dotoolc. and dotoolc.
{ echo keydown A; sleep 3; echo key H shift+1; } | dotool { echo keydown A; sleep 3; echo key H shift+1; } | dotool
dotoold & dotoold &
echo type super | dotoolc echo type super | dotoolc
echo type speedy | dotoolc echo type speedy | dotoolc
dotool will produce gobbledygook if your environment has assigned it a dotool will type gobbledygook if your environment has assigned it a different
different keyboard layout than it's simulating keycodes for. You can keyboard layout than it's simulating keycodes for. You can match them up
match them up with the environment variables DOTOOL_XKB_LAYOUT and with the environment variables DOTOOL_XKB_LAYOUT and DOTOOL_XKB_VARIANT.
DOTOOL_XKB_VARIANT.
echo type azerty | DOTOOL_XKB_LAYOUT=fr dotool echo type azerty | DOTOOL_XKB_LAYOUT=fr dotool
--list-keys --list-keys
Print the possible Linux keys and exit. Print the possible Linux keys and exit.
--list-x-keys --list-x-keys
Print the possible XKB keys and exit. Print the possible XKB keys and exit.
--version --version
Print the version and exit. Print the version and exit.`)
`)
} }
func fatal(a ...any) { func fatal(a ...any) {

View file

@ -1,9 +1,8 @@
#!/bin/sh #!/bin/sh
if [ $# != 0 ]; then if [ $# != 0 ]; then
echo 'dotoolc writes its stdin to the pipe being read by dotoold. echo 'dotoolc writes its stdin to the pipe being read by dotoold. dotoolc will
dotoolc will exit immediately if the pipe is not being read. exit immediately if the pipe is not being read. The path of the pipe
The path of the pipe is $DOTOOL_PIPE else /tmp/dotool-pipe. is $DOTOOL_PIPE else /tmp/dotool-pipe.' >&2
' >&2
[ "$1" = -h ] || [ "$1" = --help ]; exit [ "$1" = -h ] || [ "$1" = --help ]; exit
fi fi

View file

@ -1,9 +1,8 @@
#!/bin/sh #!/bin/sh
if [ $# != 0 ]; then if [ $# != 0 ]; then
echo 'dotoold runs dotool reading from a pipe for dotoolc to write to. echo 'dotoold runs dotool reading from a pipe for dotoolc to write to. dotoold
dotoold will exit immediately if the pipe is already being read. will exit immediately if the pipe is already being read. The path used
The path used for the pipe is $DOTOOL_PIPE else /tmp/dotool-pipe. for the pipe is $DOTOOL_PIPE else /tmp/dotool-pipe.' >&2
' >&2
[ "$1" = -h ] || [ "$1" = --help ]; exit [ "$1" = -h ] || [ "$1" = --help ]; exit
fi fi