]>
Dogcows Code - chaz/openbox/blob - scripts/defaults.py
922cd6d6ddc8900363f42ecc962a03fa1e268ba0
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 import historyplacement
# history window placement
8 # try focus something when nothing is focused
11 # choose a default focus model
12 focusmodel
.setup_click_focus() # use focusmodel.setup_sloppy_focus() instead to
13 # make focus follow the cursor
14 # set up the mouse buttons
15 behavior
.setup_window_clicks()
16 behavior
.setup_window_buttons()
17 behavior
.setup_scroll()
19 # my window placement algorithm
20 #ob.ebind(ob.EventAction.PlaceWindow, windowplacement.random)
21 ob
.ebind(ob
.EventAction
.PlaceWindow
, historyplacement
.place
)
22 # don't place terminals by history placement (xterm,aterm,rxvt)
24 if data
.client
.appClass() == "XTerm": return 0
26 historyplacement
.confirm_callback
= histplace
29 # run xterm from root clicks
30 ob
.mbind("Left", ob
.MouseContext
.Root
, ob
.MouseAction
.Click
,
31 lambda(d
): ob
.execute("xterm", d
.screen
))
33 ob
.kbind(["A-F4"], ob
.KeyContext
.All
, callbacks
.close
)
36 import stackedcycle
# functions for doing stacked 'kde-style' cycling
37 ob
.kbind(["A-Tab"], ob
.KeyContext
.All
, stackedcycle
.next
)
38 ob
.kbind(["A-S-Tab"], ob
.KeyContext
.All
, stackedcycle
.previous
40 # if you want linear cycling instead of stacked cycling ...
42 #focuscycle.raise_window = 0 # don't raise windows when they're activated
43 #ob.kbind(["A-Tab"], ob.KeyContext.All, focuscycle.next)
44 #ob.kbind(["A-S-Tab"], ob.KeyContext.All, focuscycle.previous)
46 # desktop changing bindings
47 ob
.kbind(["C-1"], ob
.KeyContext
.All
, lambda(d
): callbacks
.change_desktop(d
, 0))
48 ob
.kbind(["C-2"], ob
.KeyContext
.All
, lambda(d
): callbacks
.change_desktop(d
, 1))
49 ob
.kbind(["C-3"], ob
.KeyContext
.All
, lambda(d
): callbacks
.change_desktop(d
, 2))
50 ob
.kbind(["C-4"], ob
.KeyContext
.All
, lambda(d
): callbacks
.change_desktop(d
, 3))
51 ob
.kbind(["C-A-Right"], ob
.KeyContext
.All
,
52 lambda(d
): callbacks
.next_desktop(d
))
53 ob
.kbind(["C-A-Left"], ob
.KeyContext
.All
,
54 lambda(d
): callbacks
.prev_desktop(d
))
56 ob
.kbind(["C-S-A-Right"], ob
.KeyContext
.All
,
57 lambda(d
): callbacks
.send_to_next_desktop(d
))
58 ob
.kbind(["C-S-A-Left"], ob
.KeyContext
.All
,
59 lambda(d
): callbacks
.send_to_prev_desktop(d
))
62 ob
.ebind(ob
.EventAction
.NewWindow
, callbacks
.focus
)
64 print "Loaded defaults.py"
This page took 0.039175 seconds and 4 git commands to generate.