download from release
https://github.com/ReimuNotMoe/ydotool/releases
https://github.com/ReimuNotMoe/ydotool/releases/download/v1.0.4/ydotool-release-ubuntu-latest
https://github.com/ReimuNotMoe/ydotool/releases/download/v1.0.4/ydotoold-release-ubuntu-latest
mv ydotool-release-ubuntu-latest ~/.bin/ydotool
mv ydotoold-release-ubuntu-latest ~/.bin/ydotoold
sudo ydotoold -p /run/user/1000/.ydotool_socket -o 1000:1000
ydotool mousemove -x -100 -y 100
ydotool mousemove --absolute -x 100 -y 100
for screen resolution 1920x1080 x=0-
1919 y=0-
1079
ydotool mousemove --absolute -x 0 -y 0 ##moves to top left
ydotool mousemove --absolute -x 960 -y 0 ##moves to top right
ydotool mousemove --absolute -x 0 -y 540 ## moves bottom left
ydotool mousemove --absolute -x 960 -y 540 ## moves bottom left
right click
ydotool click 0xC1
left click
ydotool click 0xC0
repeating left click
ydotool click --repeat 5 --next-delay 25 0xC0
delay is in ms
ydotool click --repeat 50000 --next-delay 1000 0xC0
ydotool mousemove --absolute -x 398 -y 981
click
0xC0
get mouse position with
bindsym $mod+z exec notify-send "$(slurp -p)"
the position used by ydotool is half of given by slurp for some reasons
nano autofollow.sh
------------------------------------------------------------------------------------------------
for i in {0..100}
do
ydotool mousemove --absolute -x 210 -y 502
ydotool click 0xC0
ydotool mousemove --absolute -x 403 -y 502
ydotool click 0xC0
ydotool mousemove --absolute -x 613 -y 502
ydotool click 0xC0
ydotool mousemove --absolute -x 815 -y 502
ydotool click 0xC0
sleep 10
done
------------------------------------------------------------------------------------------------
nano calibrate.sh
for i in {0..960}
do
ydotool mousemove --absolute -x $i -y 0
sleep 0.01
echo $i
done
for i in {0..540}
do
ydotool mousemove --absolute -x 0 -y $i
sleep 0.01
echo $i
done
clicking uniformly spaced buttons
nano pfzoom.sh
------------------------------------------------------------------------------------------------
#!/bin/bash
for i in {62..919..61}
do
ydotool mousemove --absolute -x $i -y 524
ydotool click 0xC0
done
------------------------------------------------------------------------------------------------
docs
Usage: ydotool <cmd> <args>
Available commands:
click
mousemove
type
key
debug
bakers
Use environment variable YDOTOOL_SOCKET to specify daemon socket.
ydotool click
Usage: click [OPTION]... [BUTTONS]...
Click mouse buttons.
Options:
-r, --repeat=N Repeat entire sequence N times
-D, --next-delay=N Delay N milliseconds between input events (up/down, a complete click means doubled time)
-h, --help Display this help and exit
How to specify buttons:
Now all mouse buttons are represented using hexadecimal numeric values, with an optional
bit mask to specify if mouse up/down needs to be omitted.
0x00 - LEFT
0x01 - RIGHT
0x02 - MIDDLE
0x03 - SIDE
0x04 - EXTR
0x05 - FORWARD
0x06 - BACK
0x07 - TASK
0x40 - Mouse down
0x80 - Mouse up
Examples:
0x00: chooses left button, but does nothing (you can use this to implement extra sleeps)
0xC0: left button click (down then up)
0x41: right button down
0x82: middle button up
The '0x' prefix can be omitted if you want.
Comments
Post a Comment