Drop obsolete muttng from /etc/skel/.fluxbox/menu and /etc/skel/.pekwm/menu, thanks...
[grml-desktop.git] / etc / skel / .ion2 / pwm-bindings.lua
1 -- 
2 -- PWM 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 menu display callbacks.
8 include("menulib")
9 -- Load a library to create common queries.
10 --include("querylib.lua")
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 PWM manual page
49                                   local m=lookup_script("ion-man")
50                                   if m then
51                                       exec_in(scr, m.." pwm")
52                                   end
53                               end),
54     kpress("F2", make_exec_fn("x-terminal-emulator")),
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
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
72
73 -- mplex_bindings
74 --
75 -- These bindings work in frames and on screens. The innermost of such
76 -- objects always gets to handle the key press. Essentially these bindings
77 -- are used to define actions on client windows. (Remember that client
78 -- windows can be put in fullscreen mode and therefore may not have a
79 -- frame.)
80 -- 
81 -- The make_*_fn functions are used to call functions on the object currently 
82 -- managed by the screen or frame or the frame itself. Essentially e.g.
83 -- make_mplex_clientwin_fn(fn) expands to
84 -- 
85 -- function(mplex, sub)
86 --     local reg=(sub or mplex:current())
87 --     if obj_is(reg, "WClientWin") then 
88 --         fn(reg)
89 --     end
90 -- end
91 -- 
92 -- For details see the document "Ion: Configuring and extending with Lua".
93
94 mplex_bindings{
95     kpress_waitrel(DEFAULT_MOD.."C", WMPlex.close_sub_or_self),
96     kpress_waitrel(DEFAULT_MOD.."L", 
97                    make_mplex_clientwin_fn(WClientWin.broken_app_resize_kludge)),
98     kpress_waitrel(DEFAULT_MOD.."Return", 
99                    make_mplex_clientwin_fn(WClientWin.toggle_fullscreen)),
100
101     submap(DEFAULT_MOD.."K", {
102         kpress("AnyModifier+C",
103                make_mplex_clientwin_fn(WClientWin.kill)),
104         kpress("AnyModifier+Q", 
105                make_mplex_clientwin_fn(WClientWin.quote_next)),
106     }),
107 }
108
109
110 -- genframe_bindings
111 --
112 -- These bindings are common to all types of frames. The rest of frame
113 -- bindings that differ between frame types are defined in the modules' 
114 -- configuration files.
115
116 genframe_bindings{
117     -- Tag viewed object
118     kpress(DEFAULT_MOD.."T", make_mplex_sub_fn(WRegion.toggle_tag)),
119
120     submap(DEFAULT_MOD.."K", {
121         -- Selected object/tab switching
122         kpress("AnyModifier+N", WGenFrame.switch_next),
123         kpress("AnyModifier+P", WGenFrame.switch_prev),
124         kpress("AnyModifier+1", function(f) f:switch_nth(0) end),
125         kpress("AnyModifier+2", function(f) f:switch_nth(1) end),
126         kpress("AnyModifier+3", function(f) f:switch_nth(2) end),
127         kpress("AnyModifier+4", function(f) f:switch_nth(3) end),
128         kpress("AnyModifier+5", function(f) f:switch_nth(4) end),
129         kpress("AnyModifier+6", function(f) f:switch_nth(5) end),
130         kpress("AnyModifier+7", function(f) f:switch_nth(6) end),
131         kpress("AnyModifier+8", function(f) f:switch_nth(7) end),
132         kpress("AnyModifier+9", function(f) f:switch_nth(8) end),
133         kpress("AnyModifier+0", function(f) f:switch_nth(9) end),
134         -- Maximize
135         kpress("AnyModifier+H", WGenFrame.maximize_horiz),
136         kpress("AnyModifier+V", WGenFrame.maximize_vert),
137         -- Attach tagged objects
138         kpress("AnyModifier+A", WGenFrame.attach_tagged),
139     }),
140     
141     -- Queries
142     --[[
143     kpress(DEFAULT_MOD.."A", querylib.query_attachclient),
144     kpress(DEFAULT_MOD.."G", querylib.query_gotoclient),
145     kpress(SECOND_MOD.."F1", querylib.query_man),
146     kpress(SECOND_MOD.."F3", querylib.query_exec),
147     kpress(DEFAULT_MOD.."F3", querylib.query_lua),
148     kpress(SECOND_MOD.."F4", querylib.query_ssh),
149     kpress(SECOND_MOD.."F5", querylib.query_editfile),
150     kpress(SECOND_MOD.."F6", querylib.query_runfile),
151     kpress(SECOND_MOD.."F9", querylib.query_workspace),
152     --]]
153     -- Menus
154     kpress(DEFAULT_MOD.."M", make_menu_fn("ctxmenu")),
155     mpress("Button3", make_pmenu_fn("ctxmenu"), "tab"),
156 }
157