give the debian pkg names
[mikachu/openbox.git] / scripts / defaults.py
1 import focus      # add some default focus handling and cycling functions
2 import focusmodel # default focus models
3 import behavior   # defines default behaviors for interaction with windows
4 import callbacks  # a lib of functions that can be used as binding callbacks
5 import windowplacement # use a routine in here to place windows
6
7 # try focus something when nothing is focused
8 focus.fallback = 1
9
10 # set up the mouse buttons
11 focusmodel.setup_sloppy_focus()
12 behavior.setup_window_clicks()
13 behavior.setup_window_buttons()
14 behavior.setup_scroll()
15
16 # my window placement algorithm
17 ob.ebind(ob.EventAction.PlaceWindow, windowplacement.random)
18
19 # run xterm from root clicks
20 ob.mbind("Left", ob.MouseContext.Root, ob.MouseAction.Click,
21          lambda(d): ob.execute("xterm", d.screen))
22
23 ob.kbind(["A-F4"], ob.KeyContext.All, callbacks.close)
24
25 # focus bindings
26 ob.kbind(["A-Tab"], ob.KeyContext.All, focus.focus_next_stacked)
27 ob.kbind(["A-S-Tab"], ob.KeyContext.All, focus.focus_prev_stacked)
28
29 # desktop changing bindings
30 ob.kbind(["C-1"], ob.KeyContext.All, lambda(d): callbacks.change_desktop(d, 0))
31 ob.kbind(["C-2"], ob.KeyContext.All, lambda(d): callbacks.change_desktop(d, 1))
32 ob.kbind(["C-3"], ob.KeyContext.All, lambda(d): callbacks.change_desktop(d, 2))
33 ob.kbind(["C-4"], ob.KeyContext.All, lambda(d): callbacks.change_desktop(d, 3))
34 ob.kbind(["C-A-Right"], ob.KeyContext.All,
35          lambda(d): callbacks.next_desktop(d))
36 ob.kbind(["C-A-Left"], ob.KeyContext.All,
37          lambda(d): callbacks.prev_desktop(d))
38
39 ob.kbind(["C-S-A-Right"], ob.KeyContext.All,
40          lambda(d): callbacks.send_to_next_desktop(d))
41 ob.kbind(["C-S-A-Left"], ob.KeyContext.All,
42          lambda(d): callbacks.send_to_prev_desktop(d))
43
44 # focus new windows
45 ob.ebind(ob.EventAction.NewWindow, callbacks.focus)
46
47 print "Loaded defaults.py"