vt: respect relative position mode when clamping cursor
[dvtm.git] / config.h
blob2b00776f213d73352a1c3e6afde04cc3c753a9bc
1 /* curses attributes for the currently focused window */
2 /* valid curses attributes are listed below they can be ORed
4 * A_NORMAL Normal display (no highlight)
5 * A_STANDOUT Best highlighting mode of the terminal.
6 * A_UNDERLINE Underlining
7 * A_REVERSE Reverse video
8 * A_BLINK Blinking
9 * A_DIM Half bright
10 * A_BOLD Extra bright or bold
11 * A_PROTECT Protected mode
12 * A_INVIS Invisible or blank mode
15 #define BLUE (COLORS==256 ? 68 : COLOR_BLUE)
17 #define SELECTED_ATTR A_NORMAL
18 #define SELECTED_FG BLUE
19 #define SELECTED_BG -1
20 /* curses attributes for normal (not selected) windows */
21 #define NORMAL_ATTR A_NORMAL
22 #define NORMAL_FG -1
23 #define NORMAL_BG -1
24 /* status bar (command line option -s) position */
25 #define BAR_POS BAR_TOP /* BAR_BOTTOM, BAR_OFF */
26 /* curses attributes for the status bar */
27 #define BAR_ATTR A_NORMAL
28 #define BAR_FG BLUE
29 #define BAR_BG -1
30 /* determines whether the statusbar text should be right or left aligned */
31 #define BAR_ALIGN ALIGN_RIGHT
32 /* separator between window title and window number */
33 #define SEPARATOR " | "
34 /* printf format string for the window title, first %s
35 * is replaced by the title, second %s is replaced by
36 * the SEPARATOR, %d stands for the window number */
37 #define TITLE "[%s%s#%d]"
38 /* master width factor [0.1 .. 0.9] */
39 #define MFACT 0.5
40 /* scroll back buffer size in lines */
41 #define SCROLL_HISTORY 500
43 #include "tile.c"
44 #include "grid.c"
45 #include "bstack.c"
46 #include "fullscreen.c"
48 /* by default the first layout entry is used */
49 Layout layouts[] = {
50 { "[]=", tile },
51 { "+++", grid },
52 { "TTT", bstack },
53 { "[ ]", fullscreen },
56 #define MOD CTRL('g')
58 /* you can at most specifiy MAX_ARGS (2) number of arguments */
59 Key keys[] = {
60 { MOD, 'c', { create, { NULL } } },
61 { MOD, 'x', { killclient, { NULL } } },
62 { MOD, 'j', { focusnext, { NULL } } },
63 { MOD, 'u', { focusnextnm, { NULL } } },
64 { MOD, 'i', { focusprevnm, { NULL } } },
65 { MOD, 'k', { focusprev, { NULL } } },
66 { MOD, 't', { setlayout, { "[]=" } } },
67 { MOD, 'g', { setlayout, { "+++" } } },
68 { MOD, 'b', { setlayout, { "TTT" } } },
69 { MOD, 'm', { setlayout, { "[ ]" } } },
70 { MOD, ' ', { setlayout, { NULL } } },
71 { MOD, 'h', { setmfact, { "-0.05" } } },
72 { MOD, 'l', { setmfact, { "+0.05" } } },
73 { MOD, '.', { toggleminimize, { NULL } } },
74 { MOD, 's', { togglebar, { NULL } } },
75 { MOD, 'M', { togglemouse, { NULL } } },
76 { MOD, '\n', { zoom , { NULL } } },
77 { MOD, '1', { focusn, { "1" } } },
78 { MOD, '2', { focusn, { "2" } } },
79 { MOD, '3', { focusn, { "3" } } },
80 { MOD, '4', { focusn, { "4" } } },
81 { MOD, '5', { focusn, { "5" } } },
82 { MOD, '6', { focusn, { "6" } } },
83 { MOD, '7', { focusn, { "7" } } },
84 { MOD, '8', { focusn, { "8" } } },
85 { MOD, '9', { focusn, { "9" } } },
86 { MOD, 'q', { quit, { NULL } } },
87 { MOD, 'G', { escapekey, { NULL } } },
88 { MOD, 'a', { togglerunall, { NULL } } },
89 { MOD, 'r', { redraw, { NULL } } },
90 { MOD, 'X', { lock, { NULL } } },
91 { MOD, 'B', { togglebell, { NULL } } },
92 { MOD, KEY_PPAGE, { scrollback, { "-1" } } },
93 { MOD, KEY_NPAGE, { scrollback, { "1" } } },
94 { MOD, '?', { create, { "man dvtm", "dvtm help" } } },
97 static const ColorRule colorrules[] = {
98 /* title attrs fgcolor bgcolor */
99 #if 0
100 { "ssh", A_NORMAL, COLOR_BLACK, 224 },
101 #endif
104 /* possible values for the mouse buttons are listed below:
106 * BUTTON1_PRESSED mouse button 1 down
107 * BUTTON1_RELEASED mouse button 1 up
108 * BUTTON1_CLICKED mouse button 1 clicked
109 * BUTTON1_DOUBLE_CLICKED mouse button 1 double clicked
110 * BUTTON1_TRIPLE_CLICKED mouse button 1 triple clicked
111 * BUTTON2_PRESSED mouse button 2 down
112 * BUTTON2_RELEASED mouse button 2 up
113 * BUTTON2_CLICKED mouse button 2 clicked
114 * BUTTON2_DOUBLE_CLICKED mouse button 2 double clicked
115 * BUTTON2_TRIPLE_CLICKED mouse button 2 triple clicked
116 * BUTTON3_PRESSED mouse button 3 down
117 * BUTTON3_RELEASED mouse button 3 up
118 * BUTTON3_CLICKED mouse button 3 clicked
119 * BUTTON3_DOUBLE_CLICKED mouse button 3 double clicked
120 * BUTTON3_TRIPLE_CLICKED mouse button 3 triple clicked
121 * BUTTON4_PRESSED mouse button 4 down
122 * BUTTON4_RELEASED mouse button 4 up
123 * BUTTON4_CLICKED mouse button 4 clicked
124 * BUTTON4_DOUBLE_CLICKED mouse button 4 double clicked
125 * BUTTON4_TRIPLE_CLICKED mouse button 4 triple clicked
126 * BUTTON_SHIFT shift was down during button state change
127 * BUTTON_CTRL control was down during button state change
128 * BUTTON_ALT alt was down during button state change
129 * ALL_MOUSE_EVENTS report all button state changes
130 * REPORT_MOUSE_POSITION report mouse movement
133 #ifdef NCURSES_MOUSE_VERSION
134 # define CONFIG_MOUSE /* compile in mouse support if we build against ncurses */
135 #endif
137 #define ENABLE_MOUSE true /* whether to enable mouse events by default */
139 #ifdef CONFIG_MOUSE
140 Button buttons[] = {
141 { BUTTON1_CLICKED, { mouse_focus, { NULL } } },
142 { BUTTON1_DOUBLE_CLICKED, { mouse_fullscreen, { "[ ]" } } },
143 { BUTTON2_CLICKED, { mouse_zoom, { NULL } } },
144 { BUTTON3_CLICKED, { mouse_minimize, { NULL } } },
146 #endif /* CONFIG_MOUSE */
148 Cmd commands[] = {
149 { "create", { create, { NULL } } },
152 /* gets executed when dvtm is started */
153 Action actions[] = {
154 { create, { NULL } },