[UP] add many more ion3 cfg -_-, powerfull, and add thinkpad xorg.conf/.Xmodmap,...
[arrow.git] / archlinux_conf / etc / ion3 / cfg_ioncore.lua
blobffa0fc7b33fa1dd5c93f79418f65e6fb45073b9d
1 --
2 -- Ion core configuration file
3 --
6 --
7 -- Bindings. This includes global bindings and bindings common to
8 -- screens and all types of frames only. See modules' configuration
9 -- files for other bindings.
13 -- WScreen context bindings
15 -- The bindings in this context are available all the time.
17 -- The variable META should contain a string of the form 'Mod1+'
18 -- where Mod1 maybe replaced with the modifier you want to use for most
19 -- of the bindings. Similarly ALTMETA may be redefined to add a
20 -- modifier to some of the F-key bindings.
22 defbindings("WScreen", {
23 bdoc("Switch to n:th object (workspace, full screen client window) "..
24 "within current screen."),
25 kpress(META.."1", "WScreen.switch_nth(_, 0)"),
26 kpress(META.."2", "WScreen.switch_nth(_, 1)"),
27 kpress(META.."3", "WScreen.switch_nth(_, 2)"),
28 kpress(META.."4", "WScreen.switch_nth(_, 3)"),
29 kpress(META.."5", "WScreen.switch_nth(_, 4)"),
30 kpress(META.."6", "WScreen.switch_nth(_, 5)"),
31 kpress(META.."7", "WScreen.switch_nth(_, 6)"),
32 kpress(META.."8", "WScreen.switch_nth(_, 7)"),
33 kpress(META.."9", "WScreen.switch_nth(_, 8)"),
34 kpress(META.."0", "WScreen.switch_nth(_, 9)"),
36 bdoc("Switch to next/previous object within current screen."),
37 kpress(META.."comma", "WScreen.switch_prev(_)"),
38 kpress(META.."period", "WScreen.switch_next(_)"),
40 submap(META.."K", {
41 bdoc("Go to first region demanding attention or previously active one."),
42 kpress("K", "mod_menu.grabmenu(_, _sub, 'focuslist')"),
43 -- Alternative without (cyclable) menu
44 --kpress("K", "ioncore.goto_activity() or ioncore.goto_previous()"),
46 --bdoc("Go to previous active object."),
47 --kpress("K", "ioncore.goto_previous()"),
49 --bdoc("Go to first object on activity/urgency list."),
50 --kpress("I", "ioncore.goto_activity()"),
52 bdoc("Clear all tags."),
53 kpress("T", "ioncore.tagged_clear()"),
54 }),
56 bdoc("Go to n:th screen on multihead setup."),
57 kpress(META.."Shift+1", "ioncore.goto_nth_screen(0)"),
58 kpress(META.."Shift+2", "ioncore.goto_nth_screen(1)"),
60 bdoc("Go to next/previous screen on multihead setup."),
61 kpress(META.."Shift+comma", "ioncore.goto_prev_screen()"),
62 kpress(META.."Shift+period", "ioncore.goto_next_screen()"),
64 bdoc("Create a new workspace of chosen default type."),
65 kpress(META.."F9", "ioncore.create_ws(_)"),
67 bdoc("Display the main menu."),
68 kpress(ALTMETA.."F12", "mod_query.query_menu(_, _sub, 'mainmenu', 'Main menu:')"),
69 --kpress(ALTMETA.."F12", "mod_menu.menu(_, _sub, 'mainmenu', {big=true})"),
70 mpress("Button3", "mod_menu.pmenu(_, _sub, 'mainmenu')"),
72 bdoc("Display the window list menu."),
73 mpress("Button2", "mod_menu.pmenu(_, _sub, 'windowlist')"),
75 bdoc("Forward-circulate focus."),
76 -- '_chld' used here stands to for an actual child window that may not
77 -- be managed by the screen itself, unlike '_sub', that is likely to be
78 -- the managing group of that window. The right/left directions are
79 -- used instead of next/prev, because they work better in conjunction
80 -- with tilings.
81 kpress(META.."Tab", "ioncore.goto_next(_chld, 'right')",
82 "_chld:non-nil"),
83 submap(META.."K", {
84 bdoc("Backward-circulate focus."),
85 kpress("AnyModifier+Tab", "ioncore.goto_next(_chld, 'left')",
86 "_chld:non-nil"),
88 bdoc("Raise focused object, if possible."),
89 kpress("AnyModifier+R", "WRegion.rqorder(_chld, 'front')",
90 "_chld:non-nil"),
91 }),
93 kpress(META.."F4", 'query_url(_)'),
97 -- Client window bindings
99 -- These bindings affect client windows directly.
101 defbindings("WClientWin", {
102 bdoc("Nudge the client window. This might help with some "..
103 "programs' resizing problems."),
104 kpress_wait(META.."L", "WClientWin.nudge(_)"),
106 submap(META.."K", {
107 bdoc("Kill client owning the client window."),
108 kpress("C", "WClientWin.kill(_)"),
110 bdoc("Send next key press to the client window. "..
111 "Some programs may not allow this by default."),
112 kpress("Q", "WClientWin.quote_next(_)"),
117 -- Client window group bindings
119 defbindings("WGroupCW", {
120 bdoc("Toggle client window group full-screen mode"),
121 kpress_wait(META.."Return", "WGroup.set_fullscreen(_, 'toggle')"),
125 -- WMPlex context bindings
127 -- These bindings work in frames and on screens. The innermost of such
128 -- contexts/objects always gets to handle the key press.
130 defbindings("WMPlex", {
131 bdoc("Close current object."),
132 kpress_wait(META.."C", "WRegion.rqclose_propagate(_, _sub)"),
135 -- Frames for transient windows ignore this bindmap
136 defbindings("WMPlex.toplevel", {
137 bdoc("Toggle tag of current object."),
138 kpress(META.."T", "WRegion.set_tagged(_sub, 'toggle')", "_sub:non-nil"),
140 bdoc("Query for manual page to be displayed."),
141 kpress(ALTMETA.."F1", "mod_query.query_man(_, ':man')"),
143 bdoc("Show the Ion manual page."),
144 kpress(META.."F1", "ioncore.exec_on(_, ':man ion3')"),
146 bdoc("Run a terminal emulator."),
147 kpress(ALTMETA.."F2", "ioncore.exec_on(_, XTERM or 'arxvt')"),
149 bdoc("Query for command line to execute."),
150 kpress(ALTMETA.."F3", "mod_query.query_exec(_)"),
152 bdoc("Query for Lua code to execute."),
153 kpress(META.."F3", "mod_query.query_lua(_)"),
155 bdoc("Query for host to connect to with SSH."),
156 kpress(ALTMETA.."F4", "mod_query.query_ssh(_, ':ssh')"),
158 --bdoc("Query for file to edit."),
159 --kpress(ALTMETA.."F5",
160 -- "mod_query.query_editfile(_, 'run-mailcap --action=edit')"),
162 --bdoc("Query for file to view."),
163 --kpress(ALTMETA.."F6",
164 -- "mod_query.query_runfile(_, 'run-mailcap --action=view')"),
166 bdoc("Query for workspace to go to or create a new one."),
167 kpress(ALTMETA.."F9", "mod_query.query_workspace(_)"),
169 bdoc("Query for a client window to go to."),
170 kpress(META.."G", "mod_query.query_gotoclient(_)"),
172 bdoc("Display context menu."),
173 --kpress(META.."M", "mod_menu.menu(_, _sub, 'ctxmenu')"),
174 kpress(META.."M", "mod_query.query_menu(_, _sub, 'ctxmenu', 'Context menu:')"),
176 submap(META.."K", {
177 bdoc("Detach (float) or reattach an object to its previous location."),
178 -- By using _chld instead of _sub, we can detach/reattach queries
179 -- attached to a group. The detach code checks if the parameter
180 -- (_chld) is a group 'bottom' and detaches the whole group in that
181 -- case.
182 kpress("D", "ioncore.detach(_chld, 'toggle')", "_chld:non-nil"),
187 -- WFrame context bindings
189 -- These bindings are common to all types of frames. Some additional
190 -- frame bindings are found in some modules' configuration files.
192 defbindings("WFrame", {
193 submap(META.."K", {
194 bdoc("Maximize the frame horizontally/vertically."),
195 kpress("H", "WFrame.maximize_horiz(_)"),
196 kpress("V", "WFrame.maximize_vert(_)"),
199 bdoc("Display context menu."),
200 mpress("Button3", "mod_menu.pmenu(_, _sub, 'ctxmenu')"),
202 bdoc("Begin move/resize mode."),
203 kpress(META.."R", "WFrame.begin_kbresize(_)"),
205 bdoc("Switch the frame to display the object indicated by the tab."),
206 mclick("Button1@tab", "WFrame.p_switch_tab(_)"),
207 mclick("Button2@tab", "WFrame.p_switch_tab(_)"),
209 bdoc("Resize the frame."),
210 mdrag("Button1@border", "WFrame.p_resize(_)"),
211 mdrag(META.."Button3", "WFrame.p_resize(_)"),
213 bdoc("Move the frame."),
214 mdrag(META.."Button1", "WFrame.p_move(_)"),
216 bdoc("Move objects between frames by dragging and dropping the tab."),
217 mdrag("Button1@tab", "WFrame.p_tabdrag(_)"),
218 mdrag("Button2@tab", "WFrame.p_tabdrag(_)"),
222 -- Frames for transient windows ignore this bindmap
224 defbindings("WFrame.toplevel", {
225 bdoc("Query for a client window to attach."),
226 kpress(META.."A", "mod_query.query_attachclient(_)"),
228 submap(META.."K", {
229 -- Display tab numbers when modifiers are released
230 submap_wait("ioncore.tabnum.show(_)"),
232 bdoc("Switch to n:th object within the frame."),
233 kpress("1", "WFrame.switch_nth(_, 0)"),
234 kpress("2", "WFrame.switch_nth(_, 1)"),
235 kpress("3", "WFrame.switch_nth(_, 2)"),
236 kpress("4", "WFrame.switch_nth(_, 3)"),
237 kpress("5", "WFrame.switch_nth(_, 4)"),
238 kpress("6", "WFrame.switch_nth(_, 5)"),
239 kpress("7", "WFrame.switch_nth(_, 6)"),
240 kpress("8", "WFrame.switch_nth(_, 7)"),
241 kpress("9", "WFrame.switch_nth(_, 8)"),
242 kpress("0", "WFrame.switch_nth(_, 9)"),
244 bdoc("Switch to next/previous object within the frame."),
245 kpress("N", "WFrame.switch_next(_)"),
246 kpress("P", "WFrame.switch_prev(_)"),
248 bdoc("Move current object within the frame left/right."),
249 kpress("comma", "WFrame.dec_index(_, _sub)", "_sub:non-nil"),
250 kpress("period", "WFrame.inc_index(_, _sub)", "_sub:non-nil"),
252 bdoc("Maximize the frame horizontally/vertically."),
253 kpress("H", "WFrame.maximize_horiz(_)"),
254 kpress("V", "WFrame.maximize_vert(_)"),
256 bdoc("Attach tagged objects to this frame."),
257 kpress("A", "ioncore.tagged_attach(_)"),
261 -- Bindings for floating frames.
263 defbindings("WFrame.floating", {
264 bdoc("Toggle shade mode"),
265 mdblclick("Button1@tab", "WFrame.set_shaded(_, 'toggle')"),
267 bdoc("Raise the frame."),
268 mpress("Button1@tab", "WRegion.rqorder(_, 'front')"),
269 mpress("Button1@border", "WRegion.rqorder(_, 'front')"),
270 mclick(META.."Button1", "WRegion.rqorder(_, 'front')"),
272 bdoc("Lower the frame."),
273 mclick(META.."Button3", "WRegion.rqorder(_, 'back')"),
275 bdoc("Move the frame."),
276 mdrag("Button1@tab", "WFrame.p_move(_)"),
280 -- WMoveresMode context bindings
282 -- These bindings are available keyboard move/resize mode. The mode
283 -- is activated on frames with the command begin_kbresize (bound to
284 -- META.."R" above by default).
286 defbindings("WMoveresMode", {
287 bdoc("Cancel the resize mode."),
288 kpress("AnyModifier+Escape","WMoveresMode.cancel(_)"),
290 bdoc("End the resize mode."),
291 kpress("AnyModifier+Return","WMoveresMode.finish(_)"),
293 bdoc("Grow in specified direction."),
294 kpress("Left", "WMoveresMode.resize(_, 1, 0, 0, 0)"),
295 kpress("Right", "WMoveresMode.resize(_, 0, 1, 0, 0)"),
296 kpress("Up", "WMoveresMode.resize(_, 0, 0, 1, 0)"),
297 kpress("Down", "WMoveresMode.resize(_, 0, 0, 0, 1)"),
298 kpress("F", "WMoveresMode.resize(_, 1, 0, 0, 0)"),
299 kpress("B", "WMoveresMode.resize(_, 0, 1, 0, 0)"),
300 kpress("P", "WMoveresMode.resize(_, 0, 0, 1, 0)"),
301 kpress("N", "WMoveresMode.resize(_, 0, 0, 0, 1)"),
303 bdoc("Shrink in specified direction."),
304 kpress("Shift+Left", "WMoveresMode.resize(_,-1, 0, 0, 0)"),
305 kpress("Shift+Right", "WMoveresMode.resize(_, 0,-1, 0, 0)"),
306 kpress("Shift+Up", "WMoveresMode.resize(_, 0, 0,-1, 0)"),
307 kpress("Shift+Down", "WMoveresMode.resize(_, 0, 0, 0,-1)"),
308 kpress("Shift+F", "WMoveresMode.resize(_,-1, 0, 0, 0)"),
309 kpress("Shift+B", "WMoveresMode.resize(_, 0,-1, 0, 0)"),
310 kpress("Shift+P", "WMoveresMode.resize(_, 0, 0,-1, 0)"),
311 kpress("Shift+N", "WMoveresMode.resize(_, 0, 0, 0,-1)"),
313 bdoc("Move in specified direction."),
314 kpress(META.."Left", "WMoveresMode.move(_,-1, 0)"),
315 kpress(META.."Right", "WMoveresMode.move(_, 1, 0)"),
316 kpress(META.."Up", "WMoveresMode.move(_, 0,-1)"),
317 kpress(META.."Down", "WMoveresMode.move(_, 0, 1)"),
318 kpress(META.."F", "WMoveresMode.move(_,-1, 0)"),
319 kpress(META.."B", "WMoveresMode.move(_, 1, 0)"),
320 kpress(META.."P", "WMoveresMode.move(_, 0,-1)"),
321 kpress(META.."N", "WMoveresMode.move(_, 0, 1)"),
326 -- Menu definitions
330 -- Main menu
331 defmenu("mainmenu", {
332 menuentry("Run...", "mod_query.query_exec(_)"),
333 menuentry("Terminal", "ioncore.exec_on(_, XTERM or 'arxvt')"),
334 menuentry("Lock screen", "ioncore.exec_on(_, 'xlock')"),
335 menuentry("Help", "mod_query.query_man(_)"),
336 menuentry("About Ion", "mod_query.show_about_ion(_)"),
337 submenu("Styles", "stylemenu"),
338 submenu("Session", "sessionmenu"),
339 submenu("user", "user"),
343 -- Session control menu
344 defmenu("sessionmenu", {
345 menuentry("Save", "ioncore.snapshot()"),
346 menuentry("Restart", "ioncore.restart()"),
347 menuentry("Restart TWM", "ioncore.restart_other('twm')"),
348 menuentry("Exit", "ioncore.shutdown()"),
352 -- Context menu (frame actions etc.)
353 defctxmenu("WFrame", "Frame", {
354 -- Note: this propagates the close to any subwindows; it does not
355 -- destroy the frame itself, unless empty. An entry to destroy tiled
356 -- frames is configured in cfg_tiling.lua.
357 menuentry("Close", "WRegion.rqclose_propagate(_, _sub)"),
358 -- Low-priority entries
359 menuentry("Attach tagged", "ioncore.tagged_attach(_)", { priority = 0 }),
360 menuentry("Clear tags", "ioncore.tagged_clear()", { priority = 0 }),
361 menuentry("Window info", "mod_query.show_tree(_, _sub)", { priority = 0 }),
365 -- Context menu for groups (workspaces, client windows)
366 defctxmenu("WGroup", "Group", {
367 menuentry("Toggle tag", "WRegion.set_tagged(_, 'toggle')"),
368 menuentry("De/reattach", "ioncore.detach(_, 'toggle')"),
372 -- Context menu for workspaces
373 defctxmenu("WGroupWS", "Workspace", {
374 menuentry("Close", "WRegion.rqclose(_)"),
375 menuentry("Rename", "mod_query.query_renameworkspace(nil, _)"),
376 menuentry("Attach tagged", "ioncore.tagged_attach(_)"),
380 -- Context menu for client windows
381 defctxmenu("WClientWin", "Client window", {
382 menuentry("Kill", "WClientWin.kill(_)"),
385 dopath("cfg_mouse")