diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-01-10 09:38:51 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-01-10 09:38:51 +0000 |
| commit | 52e881dc9992f341ff88d05be64dae2b74d64240 (patch) | |
| tree | daf1135f06044498cee241b763293834c876370c | |
| parent | fa34e01daefdc856fc9ea79197c93623454253ea (diff) | |
add the random window placement algo
| -rw-r--r-- | scripts/builtins.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/builtins.py b/scripts/builtins.py index 9af47446..9b909d01 100644 --- a/scripts/builtins.py +++ b/scripts/builtins.py @@ -269,4 +269,24 @@ def setup_scroll(): mbind("C-A-4", MC_Frame, MouseClick, send_to_next_desktop) mbind("C-A-5", MC_Frame, MouseClick, send_to_prev_desktop) +############################################################################ +### Window placement algorithms, choose one of these and ebind it to the ### +### EventPlaceWindow action. ### +############################################################################ + +ob_rand = None +import random +def placewindows_random(data): + if not data.client: return + client_area = data.client.area() + screen = OBDisplay_screenInfo(data.screen) + width = screen.width() - client_area.width() + height = screen.height() - client_area.height() + global ob_rand + if not ob_rand: ob_rand = random.Random() + x = ob_rand.randrange(0, width-1) + y = ob_rand.randrange(0, height-1) + data.client.move(x, y) + + print "Loaded builtins.py" |
