forked from cosmos72/twin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
system.twinrc
557 lines (510 loc) · 12.9 KB
/
system.twinrc
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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
# Copyright (C) 2000 by Massimiliano Ghilardi
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
#
#
# This file contains the configuration for twin look-n-feel.
# By default, it is installed as ${libdir}/twin/system.twinrc
# and, provided twin is compiled with RC parser support,
# it is used as fallback configuration in case the user does not
# have his own ${HOME}/.twinrc
#
# to customize twin user interface, just copy this file in your
# home directory as `.twinrc' and edit it to your tastes.
#
# file syntax:
#
# a hash sign '#' at the beginning of a line means the line
# is a comment (you are already reading such a comment!)
#
# Many different commands are recognized, and are listed below.
# A quick summary of all keywords can be found at the end of this file.
# First command:
#
# set screen background
Background 1 High Black On Blue (
"\xb1"
)
# the screen `1' is created by twin at startup,
# so we do not need to `AddScreen 1',
# and `High Black On Blue' means `high intensity black' (i.e. gray) foreground
# on `blue' background.
#
# the complete list of colors is:
# Black Blue Green Cyan Red Magenta Yellow White
#
# and `High' can be applied both to foreground and background.
# depending on the display you use, `High' background may actually blink.
#
# the strings inside ( ) are just the screen background,
# each string representing a line.
#
# every time you must write a string, you can use hexadecimal codes like "\xb1"
# or octal codes like "\261", and double quotes surrounding the string
# are only needed to protect special characters (i.e. parentheses,
# non-alphanumerical chars, etc.). Sequences like "\?" where ? is a character
# have the same meaning as in C language:
# "\"" is a string containing a double quote,
# "\n" is a newline, and so on.
#
# create the common part of all menus
#
# you need quotes to protect reserved names
# or strings containing non-alphanumerical chars.
# again, parenthesis '(' and ')' are used to group together a list
#
# this creates the menuitem " Window ", shared by all applications,
# with the contents you see below.
#
# the command `Nop' is a do-nothing command used to insert a linebreak.
# `_Next' is a user function (all other ones are predefined by twin) and
# is defined below.
#
AddToMenu " Window " (
" Move " Interactive Move
" Resize " Interactive Resize
" Scroll " Interactive Scroll
" Center " Center
" Maximize " Maximize
" Full Screen " FullScreen
" Roll Up " Roll Toggle
"" Nop
" Raise/Lower " RaiseLower
" UnFocus " Focus Off
" Next " _Next
" List... " WindowList
"" Nop
" Refresh " Refresh
" Send Pause " SyntheticKey Pause
"" Nop
" Close " Close
"" Nop
" Kill Client " Kill
)
#
# define the user function `_Next' :
# group commands in '(' ')' and put either a newline or a ';'
# after each command. `Window 1' means first window, while
# `Window 0' is the currently focused window.
#
AddToFunc _Next ( Lower; Window 1; Focus; )
# this would be exactly the same
#
# AddToFunc _Next (
# Lower
# Window 1
# Focus
# )
#
# or you can even split the function definition:
#
# AddToFunc _Next ( Lower; Window 1; )
# AddToFunc _Next (
# Focus
# )
#
#
# These are not needed... and they override
# the borders defined by Alternate Font
#
# Border "*" Inactive (
# "ÚÄ¿"
# "³ ³"
# "ÀÄÙ"
# )
#
# Border "*" Active (
# "ÉÍ»"
# "º º"
# "Èͼ"
# )
#
# But maybe you feel funky and want different borders
# for different windows:
#
# Border "*Term*" Inactive (
# " ß "
# "Ý Þ"
# " Ü "
# )
#
# Border "Clock" Active (
# " "
# " "
# " "
# )
#
# Border "Tw*" Active (
# "ÖÍ·"
# "³ ³"
# "Óͽ"
# )
#
# menu windows have no name... and are always considered Inactive
#
# Border "" Inactive (
# "ÛßÛ"
# "Û Û"
# "ÛÜÛ"
# )
#
# create the buttons on window top border.
# allowed buttons range from 0 to 9.
#
# syntax:
# Button <number> "shape" {Left|Right} [[+|-]<position>]
#
# creates button <number> with given "shape", either on Left or Right
# of window title. Optionally, you can control where exactly to place it:
#
# `Left +<n>' or `Right +<n>' leaves <n> free spaces between this button
# and the last one on the same side.
#
# `Left <n>' or `Right <n>' specifies exact distance between button and
# window Left (Right) edge.
#
# `Left -<n>' or `Right -<n>' says to place the button <n> characters nearer
# to the border than just `Left' or `Right', possibly intersecting
# other buttons.
#
# WARNING: Button 0 must ALWAYS be the close button...
#
Button 0 "[]" Left
Button 1 "\x12\x12" Right
Button 2 "><" Right
#
# a maximize/fullscreen button. feel free to uncomment :-)
# Button 3 "+-" Right +1
#
# override the Options specified at compile time
#
# set shadows to 3x2 and enable them
GlobalFlags Shadows 3 2 +Shadows
#
# disable blink/high background
GlobalFlags -Blink
#
# do not force cursor always visible
GlobalFlags -CursorAlways
#
# disable edge screen scrolling
GlobalFlags -ScreenScroll
#
# do not hide the menu
GlobalFlags -MenuHide
#
# disable menu information row
GlobalFlags -MenuInfo
#
# don't relax menu navigation
GlobalFlags -MenuRelax
#
#
# choose the mouse button used for click-to-focus,
# for text selection and to activate window gadgets.
# 1 means Left, 2 means Middle, 3 means Right.
# this also implies a 'Focus' action when clicking in a non-focused window.
#
GlobalFlags ButtonSelection 1
#
# choose the mouse button used to paste text selection
#
GlobalFlags ButtonPaste 2
#
# keyboard bindings syntax:
#
# Key <flags> <name> <function>
#
# <flags> is optional and can be one or more of
# Shift
# Ctrl
# Alt
# remember anyway that except on X11 display twin can detect these flags
# only deducing them from the ASCII sequences it receives from the keyboard,
# so Shift is almost useless and not all keys combined with Ctrl and Alt
# make sense (i.e. they must produce a unique, identificable ASCII sequence)
#
# <name> is the name of the key as in libTwkeys.h, without the TW_ prefix.
# To be safe, <name> should be quoted. some examples:
# "Tab" "Return" "Escape" "BackSpace"
# "Left" "Up" "Right" "Down"
# "Prior" ("Page_Up") "Next" ("Page_Down")
# "Home" "End" "Insert" "Delete"
# "Pause" "Num_Lock"
# "F1" "F2" "F3" "F4" "F5" "F6" "F7" "F8" "F9" "F10" "F11" "F12"
# or any ASCII character, also in double quotes:
# "A" "[" "\xFF" and so on
#
#
# Both PAUSE and F12 pop up the menu. Feel free to use any other key.
#
Key "Pause" Interactive Menu
Key "F12" Interactive Menu
#
# this is a user contributed idea: ALT-TAB to cycle through windows.
#
Key Alt "Tab" _Next
#
# Other nifty ideas.
# These will work only on display drivers that support abstract keys.
# Currently requires one of: `tty' with Linux raw keyboard, `gfx' or `X11'.
#
#
# ALT-UP spawns a new terminal.
#
Key Alt "Up" ExecTty ""
#
# SHIFT-PAGEUP scrolls up focused window
#
Key Shift "Prior" Scroll +0 -10
#
# SHIFT-PAGEDOWN scrolls down focused window
#
Key Shift "Next" Scroll +0 +10
#
# mouse bindings syntax:
#
# Mouse <buttons-list> <context> <function>
#
#
# context is a string consisting of one or more of the following:
# 0..9 corresponding button in window title
# C window resize corner
# T window title bar
# S window sides
# B window scroll bars
# W one of T,S,B (i.e. window border except buttons and corner)
# I window inside
# M menu
# R root (screen background)
# A any of the above
#
#
# mouse bindings: left click on button 0 graciously closes the window
#
Mouse 1 0 Close
# this is subtle: doing
# Mouse H1 0 Close
# instead of
# Mouse 1 0 Close
# would close the window when you PRESS mouse left button on window close button,
# NOT when you CLICK (i.e. PRESS, then RELEASE) on it!
#
# (note: `H' means `hold'. there is also `C' which means `click',
# but it's the default and can be omitted, unless you want you want to use
# them together, meaning to execute on PRESS and again on CLICK,
# by specifying `HC' )
#
# any mouse click on button 1 does RaiseLower
Mouse 123 1 RaiseLower
# any mouse click on button 2 does Roll / UnRoll
Mouse 123 2 Roll Toggle
# these are do-nothing if Button 3 above is commented out
#
# mouse left click on button 3 does Maximize
Mouse 1 3 Maximize
# mouse middle click on button 3 does FullScreen
Mouse 2 3 FullScreen
# holding mouse left button on window title or sides does interactive move
Mouse H1 TS Interactive Move
# mouse left on window resize corner does interactive resize
# mouse-based window resize works "as expected" only on window resize corner
# (try yourself to bind some window button to Interactive Resize and see...)
#
Mouse H1 C Interactive Resize
# mouse left on window bars does interactive scroll
# unluckily, mouse-based window scrolling works properly ONLY
# on window bars...
#
Mouse H1 B Interactive Scroll
# mouse left on root unfocuses currently focused window
#
# you can create functions as complex as you like and use them
# just like built-in functions...
AddToFunc _UnFocus ( Window 0; Focus Off; )
Mouse H1 R _UnFocus
# middle button on root opens window list
Mouse H2 R WindowList
# Choose your favorite setup... for twin-classic menus, which appear only
# after you press right mouse button, use this:
#
# # right button always opens the menu
# Mouse H3 A Interactive Menu
# # mouse left on menu-bar does screen resize
# Mouse H1 M Interactive Screen
# Otherwise you can use turbovision style menus:
# they always stay visible and are selected with left button
# _on_menu_bar_
#
# left button on menu-bar opens the menu
Mouse H1 M Interactive Menu
# in this case, use mouse right button on menu-bar for screen resize
Mouse H3 M Interactive Screen
# # Or better yet, create your personal style!
# #
# now you may want some initial client...
# uncomment to pop-up a terminal and maximize it.
# `;' is the same as a newline...
#
ExecTty "" ; Wait "Twin Term" ; Maximize
# for all users too lazy to manually load the socket server from the menu:
#
# Module "socket" On
#
# you may also want:
# Module "term" On
#
# list of all RC commands available for ~/.twinrc
#
# AddScreen <screen name>
# # create a new virtual screen
#
# AddToMenu <name> (
# "entry" <function>
# ...
# )
# # add entries to the common part of all menus
#
#
# AddToFunc <name> (
# <function>
# ...
# )
#
# Background <screen> <color> (
# "string"
# ...
# )
# # set screen background
#
# Beep
#
# Border <wildcard-pattern> {Active|Inactive} (
# "ÉÍ»"
# "º º"
# "Èͼ"
# )
#
# Button <n> "<shape>" [+|-[<numeric pos>|Left|Right]]
#
# Center
# # center window
#
# Close
# # politely ask the client to close the window
#
# DeleteFunc <name>
#
# DeleteMenu <name>
#
# DeleteButton <number>
#
# DeleteScreen <screen>
#
# Exec <shell command>
#
# ExecTty <shell command>
#
# Focus [On|Off|Toggle]
#
# GlobalFlags [+|-][AltFont] [+|-][AlwaysCursor] [+|-][Blink] [+|-][EdgeScroll] [+|-][HideMenu] [+|-][MenuInfo] [+|-][MenuRelax] [+|-][Shadows <x> <y>]
#
# Interactive <kind>
# # choose one of: Scroll, Move, Resize, Screen, Menu
#
# Key <flags> <keyname> <context> <function>
# # <flags> is optional and can be one or more of
# # Shift Ctrl Alt
#
# Kill
# # brutally kill the client's connection
#
# Lower
#
# Maximize
#
# FullScreen
#
# Menu
# # pop-up the menu of the currently focused window
#
# Mouse <button> <where> <function>
#
# Module <name> [On|Off]
# load/unload given module
#
# Move [+|-]<x> [+|-]<y>
# # move window
#
# MoveScreen [+|-]<x> [+|-]<y>
# # move screen
#
# Next
# # same as Window +1
#
# Nop
# # do-nothing; used in a menu inserts a linebreak
#
# Prev
# # same as Window -1
#
# Quit
# # unconditionally quit twin!
#
# Read <file>
# # open another file and parse it, then continue with current file
# # (like #include in C files)
#
# Refresh
# # redraw all displays
#
# Restart ""|<window manager name>
# # restart the WM or load another window manager
#
# Resize [+|-]<x> [+|-]<y>
# # resize window
#
# ResizeScreen [+|-]<x> [+|-]<y>
#
# Raise
#
# RaiseLower
# # raise-and-focus or lower-and-unfocus
#
# Roll [On|Off|Toggle]
#
# Scroll [+|-]<x> [+|-]<y>
# # scrolls window contents
#
# SendToScreen <screen>
# # sends window to given screen
#
# Sleep <n>
# # sleeps <n> milliseconds
#
# Stderr <string> ...
# # send message to stderr
#
# SyntheticKey <flags> <key>
# # send the specified key event to window
#
# Wait <window name>
# # wait for specified window to be mapped
#
# Window {[+|-]<n>|<window name>}
# # sets default window to operate on
# # Window <n> :
# # n = 0 : re-get current focused window
# # n > 0 : 1 = First Window, 2 = Second, etc.
# #
# # Window {+|-}<n> :
# # n = 0 : no-op
# # n < 0 : -1 : Prev Window, -2 Prev Prev, etc.
# # n > 0 : +1 : Next Window, +2 Next Next, etc.
#
# WindowList
#