]>
Dogcows Code - chaz/openbox/blob - scripts/windowplacement.py
1 ############################################################################
2 ### Window placement algorithms, choose one of these and ebind it to the ###
3 ### ob.EventAction.PlaceWindow event. ###
4 ############################################################################
10 _rand
= random
.Random()
13 if not data
.client
: return
14 client_area
= data
.client
.area()
15 frame_size
= data
.client
.frame
.size()
16 screen_area
= ob
.openbox
.screen(data
.screen
).area()
17 print str(screen_area
.x()) + " " + str(screen_area
.y()) + " " + \
18 str(screen_area
.width()) + " " + str(screen_area
.height())
19 width
= screen_area
.width() - (client_area
.width() +
20 frame_size
.left
+ frame_size
.right
)
21 height
= screen_area
.height() - (client_area
.height() +
22 frame_size
.top
+ frame_size
.bottom
)
24 x
= _rand
.randrange(screen_area
.x(), width
-1)
25 y
= _rand
.randrange(screen_area
.y(), height
-1)
26 data
.client
.move(x
, y
)
28 print "Loaded windowplacement.py"
This page took 0.039563 seconds and 4 git commands to generate.