[ADD] conf for archlinux, <init>
[arrow.git] / archlinux_conf / etc / ion3 / cfg_ioncore.lua
blob6ebe8bc5f4ddf9b617d28e98d936804742b0c245
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 }),
96 -- Client window bindings
98 -- These bindings affect client windows directly.
100 defbindings("WClientWin", {
101 bdoc("Nudge the client window. This might help with some "..
102 "programs' resizing problems."),
103 kpress_wait(META.."L", "WClientWin.nudge(_)"),
105 submap(META.."K", {
106 bdoc("Kill client owning the client window."),
107 kpress("C", "WClientWin.kill(_)"),
109 bdoc("Send next key press to the client window. "..
110 "Some programs may not allow this by default."),
111 kpress("Q", "WClientWin.quote_next(_)"),
116 -- Client window group bindings
118 defbindings("WGroupCW", {
119 bdoc("Toggle client window group full-screen mode"),
120 kpress_wait(META.."Return", "WGroup.set_fullscreen(_, 'toggle')"),
124 -- WMPlex context bindings
126 -- These bindings work in frames and on screens. The innermost of such
127 -- contexts/objects always gets to handle the key press.
129 defbindings("WMPlex", {
130 bdoc("Close current object."),
131 kpress_wait(META.."C", "WRegion.rqclose_propagate(_, _sub)"),
134 -- Frames for transient windows ignore this bindmap
135 defbindings("WMPlex.toplevel", {
136 bdoc("Toggle tag of current object."),
137 kpress(META.."T", "WRegion.set_tagged(_sub, 'toggle')", "_sub:non-nil"),
139 bdoc("Query for manual page to be displayed."),
140 kpress(ALTMETA.."F1", "mod_query.query_man(_, ':man')"),
142 bdoc("Show the Ion manual page."),
143 kpress(META.."F1", "ioncore.exec_on(_, ':man ion3')"),
145 bdoc("Run a terminal emulator."),
146 kpress(ALTMETA.."F2", "ioncore.exec_on(_, XTERM or 'arxvt')"),
148 bdoc("Query for command line to execute."),
149 kpress(ALTMETA.."F3", "mod_query.query_exec(_)"),
151 bdoc("Query for Lua code to execute."),
152 kpress(META.."F3", "mod_query.query_lua(_)"),
154 bdoc("Query for host to connect to with SSH."),
155 kpress(ALTMETA.."F4", "mod_query.query_ssh(_, ':ssh')"),
157 --bdoc("Query for file to edit."),
158 --kpress(ALTMETA.."F5",
159 -- "mod_query.query_editfile(_, 'run-mailcap --action=edit')"),
161 --bdoc("Query for file to view."),
162 --kpress(ALTMETA.."F6",
163 -- "mod_query.query_runfile(_, 'run-mailcap --action=view')"),
165 bdoc("Query for workspace to go to or create a new one."),
166 kpress(ALTMETA.."F9", "mod_query.query_workspace(_)"),
168 bdoc("Query for a client window to go to."),
169 kpress(META.."G", "mod_query.query_gotoclient(_)"),
171 bdoc("Display context menu."),
172 --kpress(META.."M", "mod_menu.menu(_, _sub, 'ctxmenu')"),
173 kpress(META.."M", "mod_query.query_menu(_, _sub, 'ctxmenu', 'Context menu:')"),
175 submap(META.."K", {
176 bdoc("Detach (float) or reattach an object to its previous location."),
177 -- By using _chld instead of _sub, we can detach/reattach queries
178 -- attached to a group. The detach code checks if the parameter
179 -- (_chld) is a group 'bottom' and detaches the whole group in that
180 -- case.
181 kpress("D", "ioncore.detach(_chld, 'toggle')", "_chld:non-nil"),
186 -- WFrame context bindings
188 -- These bindings are common to all types of frames. Some additional
189 -- frame bindings are found in some modules' configuration files.
191 defbindings("WFrame", {
192 submap(META.."K", {
193 bdoc("Maximize the frame horizontally/vertically."),
194 kpress("H", "WFrame.maximize_horiz(_)"),
195 kpress("V", "WFrame.maximize_vert(_)"),
198 bdoc("Display context menu."),
199 mpress("Button3", "mod_menu.pmenu(_, _sub, 'ctxmenu')"),
201 bdoc("Begin move/resize mode."),
202 kpress(META.."R", "WFrame.begin_kbresize(_)"),
204 bdoc("Switch the frame to display the object indicated by the tab."),
205 mclick("Button1@tab", "WFrame.p_switch_tab(_)"),
206 mclick("Button2@tab", "WFrame.p_switch_tab(_)"),
208 bdoc("Resize the frame."),
209 mdrag("Button1@border", "WFrame.p_resize(_)"),
210 mdrag(META.."Button3", "WFrame.p_resize(_)"),
212 bdoc("Move the frame."),
213 mdrag(META.."Button1", "WFrame.p_move(_)"),
215 bdoc("Move objects between frames by dragging and dropping the tab."),
216 mdrag("Button1@tab", "WFrame.p_tabdrag(_)"),
217 mdrag("Button2@tab", "WFrame.p_tabdrag(_)"),
221 -- Frames for transient windows ignore this bindmap
223 defbindings("WFrame.toplevel", {
224 bdoc("Query for a client window to attach."),
225 kpress(META.."A", "mod_query.query_attachclient(_)"),
227 submap(META.."K", {
228 -- Display tab numbers when modifiers are released
229 submap_wait("ioncore.tabnum.show(_)"),
231 bdoc("Switch to n:th object within the frame."),
232 kpress("1", "WFrame.switch_nth(_, 0)"),
233 kpress("2", "WFrame.switch_nth(_, 1)"),
234 kpress("3", "WFrame.switch_nth(_, 2)"),
235 kpress("4", "WFrame.switch_nth(_, 3)"),
236 kpress("5", "WFrame.switch_nth(_, 4)"),
237 kpress("6", "WFrame.switch_nth(_, 5)"),
238 kpress("7", "WFrame.switch_nth(_, 6)"),
239 kpress("8", "WFrame.switch_nth(_, 7)"),
240 kpress("9", "WFrame.switch_nth(_, 8)"),
241 kpress("0", "WFrame.switch_nth(_, 9)"),
243 bdoc("Switch to next/previous object within the frame."),
244 kpress("N", "WFrame.switch_next(_)"),
245 kpress("P", "WFrame.switch_prev(_)"),
247 bdoc("Move current object within the frame left/right."),
248 kpress("comma", "WFrame.dec_index(_, _sub)", "_sub:non-nil"),
249 kpress("period", "WFrame.inc_index(_, _sub)", "_sub:non-nil"),
251 bdoc("Maximize the frame horizontally/vertically."),
252 kpress("H", "WFrame.maximize_horiz(_)"),
253 kpress("V", "WFrame.maximize_vert(_)"),
255 bdoc("Attach tagged objects to this frame."),
256 kpress("A", "ioncore.tagged_attach(_)"),
260 -- Bindings for floating frames.
262 defbindings("WFrame.floating", {
263 bdoc("Toggle shade mode"),
264 mdblclick("Button1@tab", "WFrame.set_shaded(_, 'toggle')"),
266 bdoc("Raise the frame."),
267 mpress("Button1@tab", "WRegion.rqorder(_, 'front')"),
268 mpress("Button1@border", "WRegion.rqorder(_, 'front')"),
269 mclick(META.."Button1", "WRegion.rqorder(_, 'front')"),
271 bdoc("Lower the frame."),
272 mclick(META.."Button3", "WRegion.rqorder(_, 'back')"),
274 bdoc("Move the frame."),
275 mdrag("Button1@tab", "WFrame.p_move(_)"),
279 -- WMoveresMode context bindings
281 -- These bindings are available keyboard move/resize mode. The mode
282 -- is activated on frames with the command begin_kbresize (bound to
283 -- META.."R" above by default).
285 defbindings("WMoveresMode", {
286 bdoc("Cancel the resize mode."),
287 kpress("AnyModifier+Escape","WMoveresMode.cancel(_)"),
289 bdoc("End the resize mode."),
290 kpress("AnyModifier+Return","WMoveresMode.finish(_)"),
292 bdoc("Grow in specified direction."),
293 kpress("Left", "WMoveresMode.resize(_, 1, 0, 0, 0)"),
294 kpress("Right", "WMoveresMode.resize(_, 0, 1, 0, 0)"),
295 kpress("Up", "WMoveresMode.resize(_, 0, 0, 1, 0)"),
296 kpress("Down", "WMoveresMode.resize(_, 0, 0, 0, 1)"),
297 kpress("F", "WMoveresMode.resize(_, 1, 0, 0, 0)"),
298 kpress("B", "WMoveresMode.resize(_, 0, 1, 0, 0)"),
299 kpress("P", "WMoveresMode.resize(_, 0, 0, 1, 0)"),
300 kpress("N", "WMoveresMode.resize(_, 0, 0, 0, 1)"),
302 bdoc("Shrink in specified direction."),
303 kpress("Shift+Left", "WMoveresMode.resize(_,-1, 0, 0, 0)"),
304 kpress("Shift+Right", "WMoveresMode.resize(_, 0,-1, 0, 0)"),
305 kpress("Shift+Up", "WMoveresMode.resize(_, 0, 0,-1, 0)"),
306 kpress("Shift+Down", "WMoveresMode.resize(_, 0, 0, 0,-1)"),
307 kpress("Shift+F", "WMoveresMode.resize(_,-1, 0, 0, 0)"),
308 kpress("Shift+B", "WMoveresMode.resize(_, 0,-1, 0, 0)"),
309 kpress("Shift+P", "WMoveresMode.resize(_, 0, 0,-1, 0)"),
310 kpress("Shift+N", "WMoveresMode.resize(_, 0, 0, 0,-1)"),
312 bdoc("Move in specified direction."),
313 kpress(META.."Left", "WMoveresMode.move(_,-1, 0)"),
314 kpress(META.."Right", "WMoveresMode.move(_, 1, 0)"),
315 kpress(META.."Up", "WMoveresMode.move(_, 0,-1)"),
316 kpress(META.."Down", "WMoveresMode.move(_, 0, 1)"),
317 kpress(META.."F", "WMoveresMode.move(_,-1, 0)"),
318 kpress(META.."B", "WMoveresMode.move(_, 1, 0)"),
319 kpress(META.."P", "WMoveresMode.move(_, 0,-1)"),
320 kpress(META.."N", "WMoveresMode.move(_, 0, 1)"),
325 -- Menu definitions
329 -- Main menu
330 defmenu("mainmenu", {
331 menuentry("Run...", "mod_query.query_exec(_)"),
332 menuentry("Terminal", "ioncore.exec_on(_, XTERM or 'arxvt')"),
333 menuentry("Lock screen", "ioncore.exec_on(_, 'xlock')"),
334 menuentry("Help", "mod_query.query_man(_)"),
335 menuentry("About Ion", "mod_query.show_about_ion(_)"),
336 submenu("Styles", "stylemenu"),
337 submenu("Session", "sessionmenu"),
341 -- Session control menu
342 defmenu("sessionmenu", {
343 menuentry("Save", "ioncore.snapshot()"),
344 menuentry("Restart", "ioncore.restart()"),
345 menuentry("Restart TWM", "ioncore.restart_other('twm')"),
346 menuentry("Exit", "ioncore.shutdown()"),
350 -- Context menu (frame actions etc.)
351 defctxmenu("WFrame", "Frame", {
352 -- Note: this propagates the close to any subwindows; it does not
353 -- destroy the frame itself, unless empty. An entry to destroy tiled
354 -- frames is configured in cfg_tiling.lua.
355 menuentry("Close", "WRegion.rqclose_propagate(_, _sub)"),
356 -- Low-priority entries
357 menuentry("Attach tagged", "ioncore.tagged_attach(_)", { priority = 0 }),
358 menuentry("Clear tags", "ioncore.tagged_clear()", { priority = 0 }),
359 menuentry("Window info", "mod_query.show_tree(_, _sub)", { priority = 0 }),
363 -- Context menu for groups (workspaces, client windows)
364 defctxmenu("WGroup", "Group", {
365 menuentry("Toggle tag", "WRegion.set_tagged(_, 'toggle')"),
366 menuentry("De/reattach", "ioncore.detach(_, 'toggle')"),
370 -- Context menu for workspaces
371 defctxmenu("WGroupWS", "Workspace", {
372 menuentry("Close", "WRegion.rqclose(_)"),
373 menuentry("Rename", "mod_query.query_renameworkspace(nil, _)"),
374 menuentry("Attach tagged", "ioncore.tagged_attach(_)"),
378 -- Context menu for client windows
379 defctxmenu("WClientWin", "Client window", {
380 menuentry("Kill", "WClientWin.kill(_)"),