-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathHOWTO
More file actions
75 lines (62 loc) · 2.06 KB
/
HOWTO
File metadata and controls
75 lines (62 loc) · 2.06 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
HOWTO - KEYBOARD MACRO IN X11 - 2007-09-05
=============================
*******
UPDATE - 2008-06-18
For more complex (and up-to-date) X controlling try "xautomation" tools - http://hoopajoo.net/projects/xautomation.html
*******
Sources I used:
[1] http://xmacro.sourceforge.net/
[2] http://ubuntuforums.org/showthread.php?p=3307487
-----------------------------------------
1) Install "xmacro"
Gentoo: it is "obsolete" - it hasn't been updated long time, so you must download it from Internet - but it is still fully functional!
Ubuntu: it is still included in universe package source
-----------------------------------------
2) change /etc/X11/xorg.conf & restart X11 server:
*****
Section "Module"
...
Load "record"
...
EndSection
*****
-----------------------------------------
3) Record "macro" you want:
Usage: xmacrorec2 [options]
Options:
-s FACTOR scalefactor for coordinates. Default: 1.0.
-k KEYCODE the keycode for the key used for quitting.
-v show version.
-h this help.
##### "ESC" (-k 9) terminates recording
$ xmacrorec2 -k 9 > quote
#####
-----------------------------------------
4) Edit your recorded file ("quote"):
* Remove (the first) line "MotionNotify..."
* Add to the first line "Delay 1"
* You can add some "Delay 1" lines, when you have long list of keys
* The last command MUST NOT end with "new line"
#Modified file "quote"
>Delay 1
>KeyStrPress a
>KeyStrRelease a
>KeyStrPress n
>KeyStrRelease n
>KeyStrPress Return
>KeyStrRelease Return
>KeyStrPress Return
>KeyStrRelease Return*EOF*
-----------------------------------------
5) Replay your "macro" to X11 server (I recommend to use delay for event ~30ms):
Usage: xmacroplay [options] remote_display
Options:
-d DELAY delay in milliseconds for events sent to remote display.
Default: 10ms.
-s FACTOR scalefactor for coordinates. Default: 1.0.
-v show version.
-h this help.
#####
$ cat quote |xmacroplay -d 30 :0.0
#####
(You can use e.g. "lineak" <http://lineak.sourceforge.net> or other application to launch your macros)