document where the posix module is on Debian
[notion/jeffpc.git] / etc / cfg_notioncore.lua
blob12b664c494b657e6c077703627839a13e5ae3875
1 --
2 -- Notion 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.."Q", "ioncore.goto_nth_screen(0)"),
59 kpress(META.."Shift+2", "ioncore.goto_nth_screen(1)"),
60 kpress(META.."W", "ioncore.goto_nth_screen(1)"),
61 kpress(META.."Shift+3", "ioncore.goto_nth_screen(2)"),
62 kpress(META.."E", "ioncore.goto_nth_screen(2)"),
64 bdoc("Go to next/previous screen on multihead setup."),
65 kpress(META.."Shift+comma", "ioncore.goto_prev_screen()"),
66 kpress(META.."I", "ioncore.goto_prev_screen()"),
67 kpress(META.."O", "ioncore.goto_next_screen()"),
68 kpress(META.."grave", "ioncore.goto_next_screen()"),
70 bdoc("Create a new workspace of chosen default type."),
71 kpress(META.."F9", "ioncore.create_ws(_)"),
73 bdoc("Display the main menu."),
74 kpress(ALTMETA.."F12", "mod_query.query_menu(_, _sub, 'mainmenu', 'Main menu:')"),
75 --kpress(ALTMETA.."F12", "mod_menu.menu(_, _sub, 'mainmenu', {big=true})"),
76 mpress("Button3", "mod_menu.pmenu(_, _sub, 'mainmenu')"),
78 bdoc("Display the window list menu."),
79 mpress("Button2", "mod_menu.pmenu(_, _sub, 'windowlist')"),
81 bdoc("Forward-circulate focus."),
82 -- '_chld' used here stands to for an actual child window that may not
83 -- be managed by the screen itself, unlike '_sub', that is likely to be
84 -- the managing group of that window. The right/left directions are
85 -- used instead of next/prev, because they work better in conjunction
86 -- with tilings.
87 kpress(META.."Tab", "ioncore.goto_next(_chld, 'right')",
88 "_chld:non-nil"),
89 submap(META.."K", {
90 bdoc("Backward-circulate focus."),
91 kpress("AnyModifier+Tab", "ioncore.goto_next(_chld, 'left')",
92 "_chld:non-nil"),
94 bdoc("Raise focused object, if possible."),
95 kpress("AnyModifier+R", "WRegion.rqorder(_chld, 'front')",
96 "_chld:non-nil"),
97 }),
102 -- Client window bindings
104 -- These bindings affect client windows directly.
106 defbindings("WClientWin", {
107 bdoc("Nudge the client window. This might help with some "..
108 "programs' resizing problems."),
109 kpress_wait(META.."L", "WClientWin.nudge(_)"),
111 submap(META.."K", {
112 bdoc("Kill client owning the client window."),
113 kpress("C", "WClientWin.kill(_)"),
115 bdoc("Send next key press to the client window. "..
116 "Some programs may not allow this by default."),
117 kpress("Q", "WClientWin.quote_next(_)"),
122 -- Client window group bindings
124 defbindings("WGroupCW", {
125 bdoc("Toggle client window group full-screen mode"),
126 kpress_wait(META.."Return", "WGroup.set_fullscreen(_, 'toggle')"),
130 -- WMPlex context bindings
132 -- These bindings work in frames and on screens. The innermost of such
133 -- contexts/objects always gets to handle the key press.
135 defbindings("WMPlex", {
136 bdoc("Close current object."),
137 kpress_wait(META.."C", "WRegion.rqclose_propagate(_, _sub)"),
140 -- Frames for transient windows ignore this bindmap
141 defbindings("WMPlex.toplevel", {
142 bdoc("Toggle tag of current object."),
143 kpress(META.."T", "WRegion.set_tagged(_sub, 'toggle')", "_sub:non-nil"),
145 bdoc("Query for manual page to be displayed."),
146 kpress(ALTMETA.."F1", "mod_query.query_man(_, ':man')"),
148 bdoc("Show the Notion manual page."),
149 kpress(META.."F1", "ioncore.exec_on(_, ':man notion')"),
151 bdoc("Run a terminal emulator."),
152 kpress(ALTMETA.."F2", "mod_query.exec_on_merr(_, XTERM or 'xterm')"),
154 bdoc("Query for command line to execute."),
155 kpress(ALTMETA.."F3", "mod_query.query_exec(_)"),
157 bdoc("Query for Lua code to execute."),
158 kpress(META.."F3", "mod_query.query_lua(_)"),
160 bdoc("Query for host to connect to with SSH."),
161 kpress(ALTMETA.."F4", "mod_query.query_ssh(_, ':ssh')"),
163 bdoc("Query for file to edit."),
164 kpress(ALTMETA.."F5",
165 "mod_query.query_editfile(_, 'run-mailcap --action=edit')"),
167 bdoc("Query for file to view."),
168 kpress(ALTMETA.."F6",
169 "mod_query.query_runfile(_, 'run-mailcap --action=view')"),
171 bdoc("Query for workspace to go to or create a new one."),
172 kpress(ALTMETA.."F9", "mod_query.query_workspace(_)"),
174 bdoc("Query for a client window to go to."),
175 kpress(META.."G", "mod_query.query_gotoclient(_)"),
177 bdoc("Display context menu."),
178 --kpress(META.."M", "mod_menu.menu(_, _sub, 'ctxmenu')"),
179 kpress(META.."M", "mod_query.query_menu(_, _sub, 'ctxmenu', 'Context menu:')"),
181 submap(META.."K", {
182 bdoc("Detach (float) or reattach an object to its previous location."),
183 -- By using _chld instead of _sub, we can detach/reattach queries
184 -- attached to a group. The detach code checks if the parameter
185 -- (_chld) is a group 'bottom' and detaches the whole group in that
186 -- case.
187 kpress("D", "ioncore.detach(_chld, 'toggle')", "_chld:non-nil"),
192 -- WFrame context bindings
194 -- These bindings are common to all types of frames. Some additional
195 -- frame bindings are found in some modules' configuration files.
197 defbindings("WFrame", {
198 submap(META.."K", {
199 bdoc("Maximize the frame horizontally/vertically."),
200 kpress("H", "WFrame.maximize_horiz(_)"),
201 kpress("V", "WFrame.maximize_vert(_)"),
204 bdoc("Display context menu."),
205 mpress("Button3", "mod_menu.pmenu(_, _sub, 'ctxmenu')"),
207 bdoc("Begin move/resize mode."),
208 kpress(META.."R", "WFrame.begin_kbresize(_)"),
210 bdoc("Switch the frame to display the object indicated by the tab."),
211 mclick("Button1@tab", "WFrame.p_switch_tab(_)"),
212 mclick("Button2@tab", "WFrame.p_switch_tab(_)"),
214 bdoc("Resize the frame."),
215 mdrag("Button1@border", "WFrame.p_resize(_)"),
216 mdrag(META.."Button3", "WFrame.p_resize(_)"),
218 bdoc("Move the frame."),
219 mdrag(META.."Button1", "WFrame.p_move(_)"),
221 bdoc("Move objects between frames by dragging and dropping the tab."),
222 mdrag("Button1@tab", "WFrame.p_tabdrag(_)"),
223 mdrag("Button2@tab", "WFrame.p_tabdrag(_)"),
227 -- Frames for transient windows ignore this bindmap
229 defbindings("WFrame.toplevel", {
230 bdoc("Query for a client window to attach."),
231 kpress(META.."A", "mod_query.query_attachclient(_)"),
233 submap(META.."K", {
234 -- Display tab numbers when modifiers are released
235 submap_wait("ioncore.tabnum.show(_)"),
237 bdoc("Switch to n:th object within the frame."),
238 kpress("1", "WFrame.switch_nth(_, 0)"),
239 kpress("2", "WFrame.switch_nth(_, 1)"),
240 kpress("3", "WFrame.switch_nth(_, 2)"),
241 kpress("4", "WFrame.switch_nth(_, 3)"),
242 kpress("5", "WFrame.switch_nth(_, 4)"),
243 kpress("6", "WFrame.switch_nth(_, 5)"),
244 kpress("7", "WFrame.switch_nth(_, 6)"),
245 kpress("8", "WFrame.switch_nth(_, 7)"),
246 kpress("9", "WFrame.switch_nth(_, 8)"),
247 kpress("0", "WFrame.switch_nth(_, 9)"),
249 bdoc("Switch to next/previous object within the frame."),
250 kpress("N", "WFrame.switch_next(_)"),
251 kpress("P", "WFrame.switch_prev(_)"),
253 bdoc("Move current object within the frame left/right."),
254 kpress("comma", "WFrame.dec_index(_, _sub)", "_sub:non-nil"),
255 kpress("period", "WFrame.inc_index(_, _sub)", "_sub:non-nil"),
257 bdoc("Maximize the frame horizontally/vertically."),
258 kpress("H", "WFrame.maximize_horiz(_)"),
259 kpress("V", "WFrame.maximize_vert(_)"),
261 bdoc("Attach tagged objects to this frame."),
262 kpress("A", "ioncore.tagged_attach(_)"),
266 -- Bindings for floating frames.
268 defbindings("WFrame.floating", {
269 bdoc("Toggle shade mode"),
270 mdblclick("Button1@tab", "WFrame.set_shaded(_, 'toggle')"),
272 bdoc("Raise the frame."),
273 mpress("Button1@tab", "WRegion.rqorder(_, 'front')"),
274 mpress("Button1@border", "WRegion.rqorder(_, 'front')"),
275 mclick(META.."Button1", "WRegion.rqorder(_, 'front')"),
277 bdoc("Lower the frame."),
278 mclick(META.."Button3", "WRegion.rqorder(_, 'back')"),
280 bdoc("Move the frame."),
281 mdrag("Button1@tab", "WFrame.p_move(_)"),
285 -- WMoveresMode context bindings
287 -- These bindings are available keyboard move/resize mode. The mode
288 -- is activated on frames with the command begin_kbresize (bound to
289 -- META.."R" above by default).
291 defbindings("WMoveresMode", {
292 bdoc("Cancel the resize mode."),
293 kpress("AnyModifier+Escape","WMoveresMode.cancel(_)"),
295 bdoc("End the resize mode."),
296 kpress("AnyModifier+Return","WMoveresMode.finish(_)"),
298 bdoc("Grow in specified direction."),
299 kpress("Left", "WMoveresMode.resize(_, 1, 0, 0, 0)"),
300 kpress("Right", "WMoveresMode.resize(_, 0, 1, 0, 0)"),
301 kpress("Up", "WMoveresMode.resize(_, 0, 0, 1, 0)"),
302 kpress("Down", "WMoveresMode.resize(_, 0, 0, 0, 1)"),
303 kpress("F", "WMoveresMode.resize(_, 1, 0, 0, 0)"),
304 kpress("B", "WMoveresMode.resize(_, 0, 1, 0, 0)"),
305 kpress("P", "WMoveresMode.resize(_, 0, 0, 1, 0)"),
306 kpress("N", "WMoveresMode.resize(_, 0, 0, 0, 1)"),
308 bdoc("Shrink in specified direction."),
309 kpress("Shift+Left", "WMoveresMode.resize(_,-1, 0, 0, 0)"),
310 kpress("Shift+Right", "WMoveresMode.resize(_, 0,-1, 0, 0)"),
311 kpress("Shift+Up", "WMoveresMode.resize(_, 0, 0,-1, 0)"),
312 kpress("Shift+Down", "WMoveresMode.resize(_, 0, 0, 0,-1)"),
313 kpress("Shift+F", "WMoveresMode.resize(_,-1, 0, 0, 0)"),
314 kpress("Shift+B", "WMoveresMode.resize(_, 0,-1, 0, 0)"),
315 kpress("Shift+P", "WMoveresMode.resize(_, 0, 0,-1, 0)"),
316 kpress("Shift+N", "WMoveresMode.resize(_, 0, 0, 0,-1)"),
318 bdoc("Move in specified direction."),
319 kpress(META.."Left", "WMoveresMode.move(_,-1, 0)"),
320 kpress(META.."Right", "WMoveresMode.move(_, 1, 0)"),
321 kpress(META.."Up", "WMoveresMode.move(_, 0,-1)"),
322 kpress(META.."Down", "WMoveresMode.move(_, 0, 1)"),
323 kpress(META.."F", "WMoveresMode.move(_,-1, 0)"),
324 kpress(META.."B", "WMoveresMode.move(_, 1, 0)"),
325 kpress(META.."P", "WMoveresMode.move(_, 0,-1)"),
326 kpress(META.."N", "WMoveresMode.move(_, 0, 1)"),
331 -- Menu definitions
335 -- Main menu
336 defmenu("mainmenu", {
337 menuentry("Run...", "mod_query.query_exec(_)"),
338 menuentry("Terminal", "mod_query.exec_on_merr(_, XTERM or 'xterm')"),
339 menuentry("Lock screen", "mod_query.exec_on_merr(_, 'xlock')"),
340 menuentry("Help", "mod_query.query_man(_)"),
341 menuentry("About Notion", "mod_query.show_about_ion(_)"),
342 submenu("Styles", "stylemenu"),
343 submenu("Session", "sessionmenu"),
347 -- Session control menu
348 defmenu("sessionmenu", {
349 menuentry("Save", "ioncore.snapshot()"),
350 menuentry("Restart", "ioncore.restart()"),
351 menuentry("Restart TWM", "ioncore.restart_other('twm')"),
352 menuentry("Exit", "ioncore.shutdown()"),
356 -- Context menu (frame actions etc.)
357 defctxmenu("WFrame", "Frame", {
358 -- Note: this propagates the close to any subwindows; it does not
359 -- destroy the frame itself, unless empty. An entry to destroy tiled
360 -- frames is configured in cfg_tiling.lua.
361 menuentry("Close", "WRegion.rqclose_propagate(_, _sub)"),
362 -- Low-priority entries
363 menuentry("Attach tagged", "ioncore.tagged_attach(_)", { priority = 0 }),
364 menuentry("Clear tags", "ioncore.tagged_clear()", { priority = 0 }),
365 menuentry("Window info", "mod_query.show_tree(_, _sub)", { priority = 0 }),
369 -- Context menu for groups (workspaces, client windows)
370 defctxmenu("WGroup", "Group", {
371 menuentry("Toggle tag", "WRegion.set_tagged(_, 'toggle')"),
372 menuentry("De/reattach", "ioncore.detach(_, 'toggle')"),
376 -- Context menu for workspaces
377 defctxmenu("WGroupWS", "Workspace", {
378 menuentry("Close", "WRegion.rqclose(_)"),
379 menuentry("Rename", "mod_query.query_renameworkspace(nil, _)"),
380 menuentry("Attach tagged", "ioncore.tagged_attach(_)"),
384 -- Context menu for client windows
385 defctxmenu("WClientWin", "Client window", {
386 menuentry("Kill", "WClientWin.kill(_)"),