]>
Dogcows Code - chaz/openbox/blob - scripts/defaults.py
7fd2273d77b80ee084a2aa7138b9605e505bdac5
1 import focus
# add some default focus handling and cycling functions
2 import stackedcycle
# functions for doing stacked 'kde-style' cycling
3 import focusmodel
# default focus models
4 import behavior
# defines default behaviors for interaction with windows
5 import callbacks
# a lib of functions that can be used as binding callbacks
6 import windowplacement
# use a routine in here to place windows
7 import historyplacement
# history window placement
9 # try focus something when nothing is focused
12 # choose a default focus model
13 focusmodel
.setup_click_focus() # use focusmodel.setup_sloppy_focus() instead to
14 # make focus follow the cursor
15 # set up the mouse buttons
16 behavior
.setup_window_clicks()
17 behavior
.setup_window_buttons()
18 behavior
.setup_scroll()
20 # my window placement algorithm
21 #ob.ebind(ob.EventAction.PlaceWindow, windowplacement.random)
22 ob
.ebind(ob
.EventAction
.PlaceWindow
, historyplacement
.place
)
23 # don't place terminals by history placement (xterm,aterm,rxvt)
25 if data
.client
.appClass() == "XTerm": return 0
27 historyplacement
.confirm_callback
= histplace
30 # run xterm from root clicks
31 ob
.mbind("Left", ob
.MouseContext
.Root
, ob
.MouseAction
.Click
,
32 lambda(d
): ob
.execute("xterm", d
.screen
))
34 ob
.kbind(["A-F4"], ob
.KeyContext
.All
, callbacks
.close
)
37 ob
.kbind(["A-Tab"], ob
.KeyContext
.All
, stackedcycle
.next
)
38 ob
.kbind(["A-S-Tab"], ob
.KeyContext
.All
, stackedcycle
.previous
)
40 # desktop changing bindings
41 ob
.kbind(["C-1"], ob
.KeyContext
.All
, lambda(d
): callbacks
.change_desktop(d
, 0))
42 ob
.kbind(["C-2"], ob
.KeyContext
.All
, lambda(d
): callbacks
.change_desktop(d
, 1))
43 ob
.kbind(["C-3"], ob
.KeyContext
.All
, lambda(d
): callbacks
.change_desktop(d
, 2))
44 ob
.kbind(["C-4"], ob
.KeyContext
.All
, lambda(d
): callbacks
.change_desktop(d
, 3))
45 ob
.kbind(["C-A-Right"], ob
.KeyContext
.All
,
46 lambda(d
): callbacks
.next_desktop(d
))
47 ob
.kbind(["C-A-Left"], ob
.KeyContext
.All
,
48 lambda(d
): callbacks
.prev_desktop(d
))
50 ob
.kbind(["C-S-A-Right"], ob
.KeyContext
.All
,
51 lambda(d
): callbacks
.send_to_next_desktop(d
))
52 ob
.kbind(["C-S-A-Left"], ob
.KeyContext
.All
,
53 lambda(d
): callbacks
.send_to_prev_desktop(d
))
56 ob
.ebind(ob
.EventAction
.NewWindow
, callbacks
.focus
)
58 print "Loaded defaults.py"
This page took 0.034889 seconds and 4 git commands to generate.