-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmouse
executable file
·54 lines (50 loc) · 1.41 KB
/
mouse
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env bash
## By Davoud Arsalani
## https://github.com/davoudarsalani/scripts
## https://github.com/davoudarsalani/scripts/blob/master/mouse
## https://raw.githubusercontent.com/davoudarsalani/scripts/master/mouse
## https://davoudarsalani.ir
x="$(xdotool getmouselocation --shell | \grep -i x | cut -d '=' -f 2)" ## OR x="$(xdotool getmouselocation | \grep -ioP '(?<=x:).*?(?= y:)')"
y="$(xdotool getmouselocation --shell | \grep -i y | cut -d '=' -f 2)" ## OR y="$(xdotool getmouselocation | \grep -ioP '(?<=y:).*?(?= screen:)')"
(( xr="x + 15" ))
(( xl="x - 15" ))
(( yd="y + 15" ))
(( yu="y - 15" ))
case "$1" in
l )
xdotool mousemove "$xl" "$y" ;;
r )
xdotool mousemove "$xr" "$y" ;;
u )
xdotool mousemove "$x" "$yu" ;;
d )
xdotool mousemove "$x" "$yd" ;;
su )
xdotool click 4 ;;
sd )
xdotool click 5 ;;
lc )
xdotool click 1 ;;
rc )
xdotool click 3 ;;
mc )
xdotool click 2 ;;
jm )
xdotool mousemove 683 383 ;;
jl )
xdotool mousemove 20 383 ;;
jr )
xdotool mousemove 1346 383 ;;
ju )
xdotool mousemove 683 40 ;;
jd )
xdotool mousemove 683 746 ;;
jlu )
xdotool mousemove 20 40 ;;
jld )
xdotool mousemove 20 746 ;;
jru )
xdotool mousemove 1346 40 ;;
jrd )
xdotool mousemove 1346 746 ;;
esac