]> git.decadent.org.uk Git - ion3.git/blob - etc/cfg_ioncore.lua
Update cfg_kludge_flash for Flash 10
[ion3.git] / etc / cfg_ioncore.lua
1 --
2 -- Ion core configuration file
3 --
4
5
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.
10 --
11
12
13 -- WScreen context bindings
14 --
15 -- The bindings in this context are available all the time.
16 --
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.
21
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)"),
35     
36     bdoc("Switch to next/previous object within current screen."),
37     kpress(META.."comma", "WScreen.switch_prev(_)"),
38     kpress(META.."period", "WScreen.switch_next(_)"),
39
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()"),
45
46         --bdoc("Go to previous active object."),
47         --kpress("K", "ioncore.goto_previous()"),
48         
49         --bdoc("Go to first object on activity/urgency list."),
50         --kpress("I", "ioncore.goto_activity()"),
51         
52         bdoc("Clear all tags."),
53         kpress("T", "ioncore.tagged_clear()"),
54     }),
55
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)"),
59     
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()"),
63     
64     bdoc("Create a new workspace of chosen default type."),
65     kpress(META.."F9", "ioncore.create_ws(_)"),
66     
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')"),
71     
72     bdoc("Display the window list menu."),
73     mpress("Button2", "mod_menu.pmenu(_, _sub, 'windowlist')"),
74
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"),
87         
88         bdoc("Raise focused object, if possible."),
89         kpress("AnyModifier+R", "WRegion.rqorder(_chld, 'front')",
90                "_chld:non-nil"),
91     }),
92
93 })
94
95
96 -- Client window bindings
97 --
98 -- These bindings affect client windows directly.
99
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(_)"),
104     
105     submap(META.."K", {
106        bdoc("Kill client owning the client window."),
107        kpress("C", "WClientWin.kill(_)"),
108        
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(_)"),
112     }),
113 })
114
115
116 -- Client window group bindings
117
118 defbindings("WGroupCW", {
119     bdoc("Toggle client window group full-screen mode"),
120     kpress_wait(META.."Return", "WGroup.set_fullscreen(_, 'toggle')"),
121 })
122
123
124 -- WMPlex context bindings
125 --
126 -- These bindings work in frames and on screens. The innermost of such
127 -- contexts/objects always gets to handle the key press. 
128
129 defbindings("WMPlex", {
130     bdoc("Close current object."),
131     kpress_wait(META.."C", "WRegion.rqclose_propagate(_, _sub)"),
132 })
133
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"),
138
139     bdoc("Query for manual page to be displayed."),
140     kpress(ALTMETA.."F1", "mod_query.query_man(_, ':man')"),
141
142     bdoc("Show the Ion manual page."),
143     kpress(META.."F1", "ioncore.exec_on(_, ':man ion3')"),
144
145     bdoc("Run a terminal emulator."),
146     kpress(ALTMETA.."F2", "ioncore.exec_on(_, XTERM or 'xterm')"),
147     
148     bdoc("Query for command line to execute."),
149     kpress(ALTMETA.."F3", "mod_query.query_exec(_)"),
150
151     bdoc("Query for Lua code to execute."),
152     kpress(META.."F3", "mod_query.query_lua(_)"),
153
154     bdoc("Query for host to connect to with SSH."),
155     kpress(ALTMETA.."F4", "mod_query.query_ssh(_, ':ssh')"),
156
157     bdoc("Query for file to edit."),
158     kpress(ALTMETA.."F5", 
159            "mod_query.query_editfile(_, 'run-mailcap --action=edit')"),
160
161     bdoc("Query for file to view."),
162     kpress(ALTMETA.."F6", 
163            "mod_query.query_runfile(_, 'run-mailcap --action=view')"),
164
165     bdoc("Query for workspace to go to or create a new one."),
166     kpress(ALTMETA.."F9", "mod_query.query_workspace(_)"),
167     
168     bdoc("Query for a client window to go to."),
169     kpress(META.."G", "mod_query.query_gotoclient(_)"),
170     
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:')"),
174     
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"),
182     }),
183 })
184
185
186 -- WFrame context bindings
187 --
188 -- These bindings are common to all types of frames. Some additional
189 -- frame bindings are found in some modules' configuration files.
190
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(_)"),
196     }),
197     
198     bdoc("Display context menu."),
199     mpress("Button3", "mod_menu.pmenu(_, _sub, 'ctxmenu')"),
200     
201     bdoc("Begin move/resize mode."),
202     kpress(META.."R", "WFrame.begin_kbresize(_)"),
203     
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(_)"),
207     
208     bdoc("Resize the frame."),
209     mdrag("Button1@border", "WFrame.p_resize(_)"),
210     mdrag(META.."Button3", "WFrame.p_resize(_)"),
211     
212     bdoc("Move the frame."),
213     mdrag(META.."Button1", "WFrame.p_move(_)"),
214     
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(_)"),
218            
219 })
220
221 -- Frames for transient windows ignore this bindmap
222
223 defbindings("WFrame.toplevel", {
224     bdoc("Query for a client window to attach."),
225     kpress(META.."A", "mod_query.query_attachclient(_)"),
226     
227     submap(META.."K", {
228         -- Display tab numbers when modifiers are released
229         submap_wait("ioncore.tabnum.show(_)"),
230         
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)"),
242         
243         bdoc("Switch to next/previous object within the frame."),
244         kpress("N", "WFrame.switch_next(_)"),
245         kpress("P", "WFrame.switch_prev(_)"),
246         
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"),
250                
251         bdoc("Maximize the frame horizontally/vertically."),
252         kpress("H", "WFrame.maximize_horiz(_)"),
253         kpress("V", "WFrame.maximize_vert(_)"),
254
255         bdoc("Attach tagged objects to this frame."),
256         kpress("A", "ioncore.tagged_attach(_)"),
257     }),
258 })
259
260 -- Bindings for floating frames.
261
262 defbindings("WFrame.floating", {
263     bdoc("Toggle shade mode"),
264     mdblclick("Button1@tab", "WFrame.set_shaded(_, 'toggle')"),
265     
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')"),
270     
271     bdoc("Lower the frame."),
272     mclick(META.."Button3", "WRegion.rqorder(_, 'back')"),
273     
274     bdoc("Move the frame."),
275     mdrag("Button1@tab", "WFrame.p_move(_)"),
276 })
277
278
279 -- WMoveresMode context bindings
280 -- 
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).
284
285 defbindings("WMoveresMode", {
286     bdoc("Cancel the resize mode."),
287     kpress("AnyModifier+Escape","WMoveresMode.cancel(_)"),
288
289     bdoc("End the resize mode."),
290     kpress("AnyModifier+Return","WMoveresMode.finish(_)"),
291
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)"),
301     
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)"),
311     
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)"),
321 })
322
323
324 --
325 -- Menu definitions
326 --
327
328
329 -- Main menu
330 defmenu("mainmenu", {
331     menuentry("Run...",         "mod_query.query_exec(_)"),
332     menuentry("Terminal",       "ioncore.exec_on(_, XTERM or 'xterm')"),
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"),
338 })
339
340
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()"),
347 })
348
349
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 }),
360 })
361
362
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')"), 
367 })
368
369
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(_)"),
375 })
376
377
378 -- Context menu for client windows
379 defctxmenu("WClientWin", "Client window", {
380     menuentry("Kill",           "WClientWin.kill(_)"),
381 })