]>
Dogcows Code - chaz/openbox/blob - scripts/clicks.py
c6f47d5886bd80f6eb12c8008f48b999cbcc7e2a
1 def def_click_client(action
, win
, type, modifiers
, button
, time
):
2 client
= Openbox_findClient(openbox
, win
)
5 if button
== Button1
and type == Type_CloseButton
:
7 elif button
<= Button3
and type == Type_MaximizeButton
:
8 print "OBClient_maximize(client)"
9 elif button
== Button1
and type == Type_IconifyButton
:
10 print "OBClient_iconify(client)"
11 elif button
== Button1
and type == Type_StickyButton
:
12 print "OBClient_sendtodesktop(client, 0xffffffff)"
13 elif type == Type_Titlebar
or type == Type_CloseButton
or \
14 type == Type_MaximizeButton
or type == Type_IconifyButton
or \
15 type == Type_StickyButton
or type == Type_Label
:
17 print "OBClient_shade(client)"
18 elif button
== Button5
:
19 print "OBClient_unshade(client)"
21 def def_press_model(action
, win
, type, modifiers
, button
, xroot
, yroot
, time
):
22 if button
!= Button1
: return
23 client
= Openbox_findClient(openbox
, win
)
24 if not client
or (type == Type_StickyButton
or
25 type == Type_IconifyButton
or
26 type == Type_MaximizeButton
or
27 type == Type_CloseButton
):
30 OBClient_focus(client
)
32 print "OBClient_raise(client)"
34 def def_click_root(action
, win
, type, modifiers
, button
, time
):
37 print "nothing probly.."
38 client
= Openbox_focusedClient(openbox
)
39 if client
: OBClient_unfocus(client
)
40 elif button
== Button2
:
41 print "workspace menu"
42 elif button
== Button3
:
44 elif button
== Button4
:
45 print "next workspace"
46 elif button
== Button5
:
47 print "previous workspace"
49 def def_doubleclick_client(action
, win
, type, modifiers
, button
, time
):
50 client
= Openbox_findClient(openbox
, win
)
53 if button
== Button1
and (type == Type_Titlebar
or type == Type_Label
):
54 print "OBClient_toggleshade(client)"
57 preregister(Action_ButtonPress
, def_press_model
)
58 register(Action_Click
, def_click_client
)
59 register(Action_Click
, def_click_root
)
60 register(Action_DoubleClick
, def_doubleclick_client
)
62 print "Loaded clicks.py"
This page took 0.038977 seconds and 3 git commands to generate.