Drop obsolete muttng from /etc/skel/.fluxbox/menu and /etc/skel/.pekwm/menu, thanks...
[grml-desktop.git] / etc / skel / .ion2 / ion-bindings.lua
1 -- 
2 -- Ion bindings configuration file. Global bindings and bindings common 
3 -- to screens and all types of frames only. See modules' configuration 
4 -- files for other bindings.
5 --
6
7 -- Load a library to create common queries.
8 include("querylib")
9 -- Load a library to create menu display callbacks.
10 include("menulib")
11
12
13 -- global_bindings
14 --
15 -- Global bindings are available all the time. The functions given here 
16 -- should accept WScreens as parameter. 
17 --
18 -- The variable DEFAULT_MOD should contain a string of the form 'Mod1+'
19 -- where Mod1 maybe replaced with the modifier you want to use for most
20 -- of the bindings. Similarly SECOND_MOD may be redefined to add a 
21 -- modifier to some of the F-key bindings.
22
23 global_bindings{
24     kpress(DEFAULT_MOD.."1", function(s) s:switch_nth(0) end),
25     kpress(DEFAULT_MOD.."2", function(s) s:switch_nth(1) end),
26     kpress(DEFAULT_MOD.."3", function(s) s:switch_nth(2) end),
27     kpress(DEFAULT_MOD.."4", function(s) s:switch_nth(3) end),
28     kpress(DEFAULT_MOD.."5", function(s) s:switch_nth(4) end),
29     kpress(DEFAULT_MOD.."6", function(s) s:switch_nth(5) end),
30     kpress(DEFAULT_MOD.."7", function(s) s:switch_nth(6) end),
31     kpress(DEFAULT_MOD.."8", function(s) s:switch_nth(7) end),
32     kpress(DEFAULT_MOD.."9", function(s) s:switch_nth(8) end),
33     kpress(DEFAULT_MOD.."0", function(s) s:switch_nth(9) end),
34     kpress(DEFAULT_MOD.."Left", WScreen.switch_prev),
35     kpress(DEFAULT_MOD.."Right", WScreen.switch_next),
36     
37     submap(DEFAULT_MOD.."K", {
38         kpress("AnyModifier+K", goto_previous),
39         kpress("AnyModifier+T", clear_tags),
40     }),
41     
42     kpress(DEFAULT_MOD.."Shift+1", function() goto_nth_screen(0) end),
43     kpress(DEFAULT_MOD.."Shift+2", function() goto_nth_screen(1) end),
44     kpress(DEFAULT_MOD.."Shift+Left", goto_next_screen),
45     kpress(DEFAULT_MOD.."Shift+Right", goto_prev_screen),
46     
47     kpress(DEFAULT_MOD.."F1", function(scr)
48                                   -- Display Ion's manual page
49                                   local m=lookup_script("ion-man")
50                                   if m then
51                                       exec_in(scr, m.." ion")
52                                   end
53                               end),
54     kpress(SECOND_MOD.."F2", make_exec_fn("x-terminal-emulator -fg white -bg black")),
55     
56     -- Create a new workspace with a default name.
57     kpress(DEFAULT_MOD.."F9", 
58            function(scr)
59                scr:attach_new({ type=default_ws_type, switchto=true })
60            end),
61
62     -- Menus/queries
63
64     -- KEYF11 and KEYF12 are normally defined to be the strings "F11" 
65     -- and "F12", respectively, but on SunOS, they're something  else 
66     -- (although the keys on the keyboard are the same).
67     kpress(SECOND_MOD..KEYF12, make_bigmenu_fn("mainmenu")),
68     mpress("Button2", make_pmenu_fn("windowlist")),
69     mpress("Button3", make_pmenu_fn("mainmenu")),
70     
71     --kpress(DEFAULT_MOD.."Menu", make_bigmenu_fn("mainmenu")),
72     --kpress(SECOND_MOD..KEYF11, querylib.query_restart),
73     --kpress(SECOND_MOD..KEYF12, querylib.query_exit),
74     kpress(DEFAULT_MOD.."Escape", make_exec_fn("x-terminal-emulator")),
75 }
76
77
78 -- mplex_bindings
79 --
80 -- These bindings work in frames and on screens. The innermost of such
81 -- objects always gets to handle the key press. Essentially these bindings
82 -- are used to define actions on client windows. (Remember that client
83 -- windows can be put in fullscreen mode and therefore may not have a
84 -- frame.)
85 -- 
86 -- The make_*_fn functions are used to call functions on the object currently 
87 -- managed by the screen or frame or the frame itself. Essentially e.g.
88 -- make_mplex_clientwin_fn(fn) expands to
89 -- 
90 -- function(mplex, sub)
91 --     local reg=(sub or mplex:current())
92 --     if obj_is(reg, "WClientWin") then 
93 --         fn(reg)
94 --     end
95 -- end
96 -- 
97 -- For details see the document "Ion: Configuring and extending with Lua".
98
99 mplex_bindings{
100     kpress_waitrel(DEFAULT_MOD.."C", WMPlex.close_sub_or_self),
101     kpress_waitrel(DEFAULT_MOD.."L", 
102                    make_mplex_clientwin_fn(WClientWin.broken_app_resize_kludge)),
103     kpress_waitrel(DEFAULT_MOD.."Return", 
104                    make_mplex_clientwin_fn(WClientWin.toggle_fullscreen)),
105
106     submap(DEFAULT_MOD.."K", {
107         kpress("AnyModifier+C",
108                make_mplex_clientwin_fn(WClientWin.kill)),
109         kpress("AnyModifier+Q", 
110                make_mplex_clientwin_fn(WClientWin.quote_next)),
111     }),
112 }
113
114
115 -- genframe_bindings
116 --
117 -- These bindings are common to all types of frames. The rest of frame
118 -- bindings that differ between frame types are defined in the modules' 
119 -- configuration files.
120
121 genframe_bindings{
122     -- Tag viewed object
123     kpress(DEFAULT_MOD.."T", make_mplex_sub_fn(WRegion.toggle_tag)),
124
125     submap(DEFAULT_MOD.."K", {
126         -- Selected object/tab switching
127         kpress("AnyModifier+N", WGenFrame.switch_next),
128         kpress("AnyModifier+P", WGenFrame.switch_prev),
129         kpress("AnyModifier+1", function(f) f:switch_nth(0) end),
130         kpress("AnyModifier+2", function(f) f:switch_nth(1) end),
131         kpress("AnyModifier+3", function(f) f:switch_nth(2) end),
132         kpress("AnyModifier+4", function(f) f:switch_nth(3) end),
133         kpress("AnyModifier+5", function(f) f:switch_nth(4) end),
134         kpress("AnyModifier+6", function(f) f:switch_nth(5) end),
135         kpress("AnyModifier+7", function(f) f:switch_nth(6) end),
136         kpress("AnyModifier+8", function(f) f:switch_nth(7) end),
137         kpress("AnyModifier+9", function(f) f:switch_nth(8) end),
138         kpress("AnyModifier+0", function(f) f:switch_nth(9) end),
139         -- Maximize
140         kpress("AnyModifier+H", WGenFrame.maximize_horiz),
141         kpress("AnyModifier+V", WGenFrame.maximize_vert),
142         -- Attach tagged objects
143         kpress("AnyModifier+A", WGenFrame.attach_tagged),
144     }),
145     
146     -- Queries
147     kpress(DEFAULT_MOD.."A", querylib.query_attachclient),
148     kpress(DEFAULT_MOD.."G", querylib.query_gotoclient),
149     kpress(SECOND_MOD.."F1", querylib.query_man),
150     kpress(SECOND_MOD.."F3", querylib.query_exec),
151     kpress(DEFAULT_MOD.."F3", querylib.query_lua),
152     kpress(SECOND_MOD.."F4", querylib.query_ssh),
153     kpress(SECOND_MOD.."F5", querylib.query_editfile),
154     kpress(SECOND_MOD.."F6", querylib.query_runfile),
155     kpress(SECOND_MOD.."F9", querylib.query_workspace),
156     -- Menus
157     kpress(DEFAULT_MOD.."M", make_menu_fn("ctxmenu")),
158     mpress("Button3", make_pmenu_fn("ctxmenu"), "tab"),
159 }
160