-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gosture_Help.htm
262 lines (262 loc) · 16.3 KB
/
Gosture_Help.htm
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
<!DOCTYPE html><html><head><meta charset="utf-8"><title>Gosture Readme</title>
<style>@font-face{font-family:KaTeX_AMS;src:url(fonts/KaTeX_AMS-Regular.eot);src:url(fonts/KaTeX_AMS-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_AMS-Regular.woff2) format('woff2'),url(fonts/KaTeX_AMS-Regular.woff) format('woff'),url(fonts/KaTeX_AMS-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Caligraphic;src:url(fonts/KaTeX_Caligraphic-Bold.eot);src:url(fonts/KaTeX_Caligraphic-Bold.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Caligraphic-Bold.woff2) format('woff2'),url(fonts/KaTeX_Caligraphic-Bold.woff) format('woff'),url(fonts/KaTeX_Caligraphic-Bold.ttf) format('truetype');font-weight:700;font-style:normal}@font-face{font-family:KaTeX_Caligraphic;src:url(fonts/KaTeX_Caligraphic-Regular.eot);src:url(fonts/KaTeX_Caligraphic-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Caligraphic-Regular.woff2) format('woff2'),url(fonts/KaTeX_Caligraphic-Regular.woff) format('woff'),url(fonts/KaTeX_Caligraphic-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Fraktur;src:url(fonts/KaTeX_Fraktur-Bold.eot);src:url(fonts/KaTeX_Fraktur-Bold.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Fraktur-Bold.woff2) format('woff2'),url(fonts/KaTeX_Fraktur-Bold.woff) format('woff'),url(fonts/KaTeX_Fraktur-Bold.ttf) format('truetype');font-weight:700;font-style:normal}@font-face{font-family:KaTeX_Fraktur;src:url(fonts/KaTeX_Fraktur-Regular.eot);src:url(fonts/KaTeX_Fraktur-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Fraktur-Regular.woff2) format('woff2'),url(fonts/KaTeX_Fraktur-Regular.woff) format('woff'),url(fonts/KaTeX_Fraktur-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Bold.eot);src:url(fonts/KaTeX_Main-Bold.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Main-Bold.woff2) format('woff2'),url(fonts/KaTeX_Main-Bold.woff) format('woff'),url(fonts/KaTeX_Main-Bold.ttf) format('truetype');font-weight:700;font-style:normal}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Italic.eot);src:url(fonts/KaTeX_Main-Italic.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Main-Italic.woff2) format('woff2'),url(fonts/KaTeX_Main-Italic.woff) format('woff'),url(fonts/KaTeX_Main-Italic.ttf) format('truetype');font-weight:400;font-style:italic}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Regular.eot);src:url(fonts/KaTeX_Main-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Main-Regular.woff2) format('woff2'),url(fonts/KaTeX_Main-Regular.woff) format('woff'),url(fonts/KaTeX_Main-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Math;src:url(fonts/KaTeX_Math-Italic.eot);src:url(fonts/KaTeX_Math-Italic.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Math-Italic.woff2) format('woff2'),url(fonts/KaTeX_Math-Italic.woff) format('woff'),url(fonts/KaTeX_Math-Italic.ttf) format('truetype');font-weight:400;font-style:italic}@font-face{font-family:KaTeX_SansSerif;src:url(fonts/KaTeX_SansSerif-Regular.eot);src:url(fonts/KaTeX_SansSerif-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_SansSerif-Regular.woff2) format('woff2'),url(fonts/KaTeX_SansSerif-Regular.woff) format('woff'),url(fonts/KaTeX_SansSerif-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Script;src:url(fonts/KaTeX_Script-Regular.eot);src:url(fonts/KaTeX_Script-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Script-Regular.woff2) format('woff2'),url(fonts/KaTeX_Script-Regular.woff) format('woff'),url(fonts/KaTeX_Script-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size1;src:url(fonts/KaTeX_Size1-Regular.eot);src:url(fonts/KaTeX_Size1-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Size1-Regular.woff2) format('woff2'),url(fonts/KaTeX_Size1-Regular.woff) format('woff'),url(fonts/KaTeX_Size1-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size2;src:url(fonts/KaTeX_Size2-Regular.eot);src:url(fonts/KaTeX_Size2-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Size2-Regular.woff2) format('woff2'),url(fonts/KaTeX_Size2-Regular.woff) format('woff'),url(fonts/KaTeX_Size2-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size3;src:url(fonts/KaTeX_Size3-Regular.eot);src:url(fonts/KaTeX_Size3-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Size3-Regular.woff2) format('woff2'),url(fonts/KaTeX_Size3-Regular.woff) format('woff'),url(fonts/KaTeX_Size3-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size4;src:url(fonts/KaTeX_Size4-Regular.eot);src:url(fonts/KaTeX_Size4-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Size4-Regular.woff2) format('woff2'),url(fonts/KaTeX_Size4-Regular.woff) format('woff'),url(fonts/KaTeX_Size4-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Typewriter;src:url(fonts/KaTeX_Typewriter-Regular.eot);src:url(fonts/KaTeX_Typewriter-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Typewriter-Regular.woff2) format('woff2'),url(fonts/KaTeX_Typewriter-Regular.woff) format('woff'),url(fonts/KaTeX_Typewriter-Regular.ttf) format('truetype');font-weight:400;font-style:normal}code{color:#c7254e;background-color:#f9f2f4;border-radius:4px}code{padding:2px 4px}table{background-color:transparent}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>thead>tr>th{padding:8px;line-height:1.4285714;border-top:1px solid #ddd}.table>tbody>tr>td{padding:8px;line-height:1.4285714;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>thead:first-child>tr:first-child>th{border-top:0}.table-bordered,.table-bordered>thead>tr>th,.table-bordered>tbody>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd)>td{background-color:#f9f9f9}*,*:before,*:after{box-sizing:border-box}html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:10}a{background:0 0}a:active,a:hover{outline:0}strong{font-weight:700}h1{margin:.67em 0}hr{box-sizing:content-box;height:0}code{font-size:1em}code{font-family:monospace,monospace}table{border-collapse:collapse;border-spacing:0}html{font-size:.875em;background:#fff;color:#373D49}html,body{font-family:Georgia,Cambria,serif;height:100%}body{font-size:1rem;font-weight:400;line-height:2rem;overflow:auto}ul,ol{margin-bottom:.83999rem;padding-top:.16001rem}li{-webkit-font-feature-settings:'kern' 1,'onum' 1,'liga' 1;font-feature-settings:'kern' 1,'onum' 1,'liga' 1;margin-left:1rem}p{padding-top:.66001rem;-webkit-font-feature-settings:'kern' 1,'onum' 1,'liga' 1;font-feature-settings:'kern' 1,'onum' 1,'liga' 1;margin-top:0}p{margin-bottom:1.33999rem}th,td{padding:12px}h1,h2,h3{font-family:"Source Sans Pro","Helvetica Neue",Helvetica,Arial,sans-serif;-webkit-font-feature-settings:'dlig' 1,'liga' 1,'lnum' 1,'kern' 1;font-feature-settings:'dlig' 1,'liga' 1,'lnum' 1,'kern' 1;font-style:normal;font-weight:600;margin-top:0}h1{line-height:3rem;font-size:2.0571429rem;margin-bottom:.21999rem;padding-top:.78001rem}h2{font-size:1.953125rem;margin-bottom:.1835837rem;padding-top:.8164163rem}h2,h3{line-height:3rem}h3{font-size:1.6457143rem;margin-bottom:.07599rem;padding-top:.92401rem}a{cursor:pointer;color:#35D7BB;text-decoration:none}a:hover,a:focus{border-bottom-color:#35D7BB;color:#dff9f4}#preview .table{width:auto}@media screen and (min-width:27.5em){html{font-size:.875em}body{font-size:1rem}ul,ol{margin-bottom:.83999rem;padding-top:.16001rem}p{padding-top:.66001rem}p{margin-bottom:1.33999rem}h1{font-size:2.0571429rem;margin-bottom:.21999rem;padding-top:.78001rem}h2{font-size:1.953125rem;margin-bottom:.1835837rem;padding-top:.8164163rem}h3{font-size:1.6457143rem;margin-bottom:.07599rem;padding-top:.92401rem}}@media screen and (min-width:46.25em){html{font-size:.875em}body{font-size:1rem}ul,ol{margin-bottom:.83999rem;padding-top:.16001rem}p{padding-top:.66001rem}p{margin-bottom:1.33999rem}h1{font-size:2.0571429rem;margin-bottom:.21999rem;padding-top:.78001rem}h2{font-size:1.953125rem;margin-bottom:.1835837rem;padding-top:.8164163rem}h3{font-size:1.6457143rem;margin-bottom:.07599rem;padding-top:.92401rem}}@media screen and (min-width:62.5em){html{font-size:.875em}body{font-size:1rem}ul,ol{margin-bottom:.83999rem;padding-top:.16001rem}p{padding-top:.66001rem}p{margin-bottom:1.33999rem}h1{font-size:2.0571429rem;margin-bottom:.21999rem;padding-top:.78001rem}h2{font-size:1.953125rem;margin-bottom:.1835837rem;padding-top:.8164163rem}h3{font-size:1.6457143rem;margin-bottom:.07599rem;padding-top:.92401rem}}@media screen and (min-width:87.5em){html{font-size:.875em}body{font-size:1rem}ul,ol{margin-bottom:.83999rem;padding-top:.16001rem}p{padding-top:.66001rem}p{margin-bottom:1.33999rem}h1{font-size:2.0571429rem;margin-bottom:.21999rem;padding-top:.78001rem}h2{font-size:1.953125rem;margin-bottom:.1835837rem;padding-top:.8164163rem}h3{font-size:1.6457143rem;margin-bottom:.07599rem;padding-top:.92401rem}}</style>
</head><body id="preview">
<h1><a id="Gosture"></a>Gosture</h1>
<p><strong>By AyuanX, 22-Aug-2018</strong></p>
<hr>
<h2><a id="What_is_Gosture_4"></a>What is Gosture</h2>
<p>Gosture is a Linux X Window system productivity tool, written in Go language.<br>
Gosture implements system-wide customizable mouse gestures as well as keyboard shortcuts.</p>
<h2><a id="How_to_use_Gosture_8"></a>How to use Gosture</h2>
<ol>
<li>Prepare your Gosture configuration file at <code>~/.Gosture.cfg</code>.<br>
An example of configuration file is provided as <code>Gosture_Config_Example.txt</code>.<br>
You can use it as a starting point. E.g. run <code>cp Gosture_Config_Example.txt ~/.Gosture.cfg</code></li>
<li>Tweak the configuration to your needs. (Check detailed instructions below.)</li>
<li>Run Gosture in background and enjoy the mouse gestures and keyboard shortcuts. E.g. run <code>nohup ./Gosture &</code><br>
After launching, you can control it through the icon in system tray.<br>
Tip: you can add it into your X Window Startup Applications so that it automatically runs at your login.</li>
</ol>
<p>The following operations are defined by default in the provided configuration example:</p>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Operation</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>Mouse Middle Button</td>
<td>Trigger a mouse gesture</td>
</tr>
<tr>
<td>Gesture ↙</td>
<td>Minimize active window</td>
</tr>
<tr>
<td>Gesture ↗</td>
<td>Maximize / Restore active window</td>
</tr>
<tr>
<td>Gesture ↓→</td>
<td>Close active window</td>
</tr>
<tr>
<td>Gesture ↑</td>
<td>Scroll to top (Equivalent to Home key)</td>
</tr>
<tr>
<td>Gesture ↓</td>
<td>Scroll to bottom (Equivalent to End key)</td>
</tr>
<tr>
<td>Gesture ←</td>
<td>Copy selection to clipboard (Equivalent to Ctrl+Insert)</td>
</tr>
<tr>
<td>Gesture →</td>
<td>Paste from clipboard (Equivalent to Shift+Insert)</td>
</tr>
<tr>
<td>Gesture ↑↓</td>
<td>Snap window to top edge (Equivalent to Super+Up)</td>
</tr>
<tr>
<td>Gesture ↓↑</td>
<td>Snap window to bottom edge (Equivalent to Super+Down)</td>
</tr>
<tr>
<td>Gesture ←→</td>
<td>Snap window to left edge (Equivalent to Super+Left)</td>
</tr>
<tr>
<td>Gesture →←</td>
<td>Snap window to right edge (Equivalent to Super+Right)</td>
</tr>
<tr>
<td>Super+Alt+Z</td>
<td>Run gedit <em>(Super key is also known as Windows key)</em></td>
</tr>
<tr>
<td>Super+Alt+X</td>
<td>Run terminal <em>(Super key is also known as Windows key)</em></td>
</tr>
<tr>
<td>Super+Alt+C</td>
<td>Run calculator <em>(Super key is also known as Windows key)</em></td>
</tr>
</tbody>
</table>
<h2><a id="How_to_configure_Gosture_36"></a>How to configure Gosture</h2>
<p>Gosture configuration file <code>~/.Gosture.cfg</code> is a standard JSON file.</p>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Option</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>mouse-gesture-enable</code></td>
<td><code>true</code>: enable mouse gesture; <code>false</code>: disable mouse gesture</td>
</tr>
<tr>
<td><code>mouse-gesture-trigger</code></td>
<td>can be a single <strong>[Mouse Button]</strong> like <code>2</code>; or a <strong>[Modifier Key]-[Mouse Button]</strong> combination, like <code>Control-2</code></td>
</tr>
</tbody>
</table>
<h3><a id="Definition_of_mouse_buttons_43"></a>Definition of mouse buttons:</h3>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Mouse Button</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>1</code></td>
<td>Left Button</td>
</tr>
<tr>
<td><code>2</code></td>
<td>Middle Button</td>
</tr>
<tr>
<td><code>3</code></td>
<td>Right Button</td>
</tr>
<tr>
<td><code>4</code></td>
<td>Scroll Up</td>
</tr>
<tr>
<td><code>5</code></td>
<td>Scroll Down</td>
</tr>
</tbody>
</table>
<h3><a id="Definition_of_keys_52"></a>Definition of keys:</h3>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Modifier Key</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>Shift</code></td>
<td>Shift Key</td>
</tr>
<tr>
<td><code>Lock</code></td>
<td>Caps Lock Key</td>
</tr>
<tr>
<td><code>Control</code></td>
<td>Ctrl Key</td>
</tr>
<tr>
<td><code>Mod1</code></td>
<td>Alt Key</td>
</tr>
<tr>
<td><code>Mod2</code></td>
<td>Num Lock Key</td>
</tr>
<tr>
<td><code>Mod3</code></td>
<td><em>(Usually not mapped to any physical key)</em></td>
</tr>
<tr>
<td><code>Mod4</code></td>
<td>Super Key (also known as Windows Key)</td>
</tr>
<tr>
<td><code>Mod5</code></td>
<td>AltGr Key (usually absent on US keyboard)</td>
</tr>
</tbody>
</table>
<ul>
<li>To get an acurate list of all modifier keys in your system, run <code>xmodmap</code>.</li>
<li>To find a specific key name, run <code>xev</code>.<br>
You can also reference these documents:<br>
<a href="http://xahlee.info/linux/linux_show_keycode_keysym.html">http://xahlee.info/linux/linux_show_keycode_keysym.html</a><br>
<a href="http://wiki.linuxquestions.org/wiki/List_of_Keysyms_Recognised_by_Xmodmap">http://wiki.linuxquestions.org/wiki/List_of_Keysyms_Recognised_by_Xmodmap</a></li>
</ul>
<h3><a id="Definition_of_mouse_gestures_69"></a>Definition of mouse gestures:</h3>
<p>All eight directions are supported; directions are mapped to digits on <strong>Num Pad</strong>.</p>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>.</th>
<th>.</th>
<th>.</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>7</code> (↖)</td>
<td><code>8</code> (↑)</td>
<td><code>9</code> (↗)</td>
</tr>
<tr>
<td><code>4</code> (←)</td>
<td></td>
<td><code>6</code> (→)</td>
</tr>
<tr>
<td><code>1</code> (↙)</td>
<td><code>2</code> (↓)</td>
<td><code>3</code> (↘)</td>
</tr>
</tbody>
</table>
<ul>
<li>For example: gesture of “↑→” is <code>86</code>; gesture of “↖↘” is <code>73</code>; gesture of “←↓→” is <code>426</code>.<br>
Tip: Mixture of orthogonal stroke and diagonal stroke in one gesture (like "↗→" or "↙↓↘") is supported, but not recommended.</li>
</ul>
<h3><a id="Currently_supported_actions_80"></a>Currently supported actions:</h3>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Action</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>minwin</code></td>
<td>Minimize active window</td>
</tr>
<tr>
<td><code>maxwin</code></td>
<td>Maximize active window / Restore it if already maximized</td>
</tr>
<tr>
<td><code>closewin</code></td>
<td>Close active window</td>
</tr>
<tr>
<td><code>key,[key1],[key2],...</code></td>
<td>Send a key combination. Each key is delimited by comma</td>
</tr>
<tr>
<td><code>cmd,[executable],[dir]</code></td>
<td>Run [executable], can be a program or script with arguments. [dir] is optional working directory</td>
</tr>
</tbody>
</table>
<h2><a id="Dependencies_and_credits_89"></a>Dependencies and credits</h2>
<ul>
<li><a href="https://github.com/BurntSushi/xgbutil">https://github.com/BurntSushi/xgbutil</a></li>
<li><a href="https://github.com/mattn/go-shellwords">https://github.com/mattn/go-shellwords</a></li>
<li><a href="https://github.com/getlantern/systray">https://github.com/getlantern/systray</a></li>
<li><a href="https://github.com/skratchdot/open-golang">https://github.com/skratchdot/open-golang</a></li>
</ul>
</body></html>