summaryrefslogtreecommitdiff
path: root/README
blob: 884b45f158d02d02a365c7c4a3a1d9dab9a82eb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
python-compiz-manager - Python module for using Compiz easily


Dependencies: 
Development packages for the following:
    - glib-2.0
    - X11
    - Xmu
    - X11-xcb
    - xcb
On Ubuntu 8.10 these are packaged as: 
x11proto-core-dev libx11-dev libxmu-dev libglib2.0-dev


IMPORTANT:
--------------------------------------------------------------------------------
Currently to configure enable window listing you must first build the module.
You can do this by going to the folder where this file in located and using:

~$ python CompizPyWindowList-setup.py build_ext -i

If that for some reason fails check CompizPyWindowList-setup.py and make sure
you've satisfied all the dependencies, and that the directories in the 
'include_dirs' match on your machine. Intruction for how to do this are
described in the file.
--------------------------------------------------------------------------------


USAGE:
--------------------------------------------------------------------------------
I hope to briefly outline how this module can be used through some examples:
--------------------------------------------------------------------------------
import CompizManager
manager = CompizManager.CompizManager()

# Lets drew a line with the water plugin
waterPlugin = manager.getPlugin('water')
waterPlugin.doAction('line',{'x0':40,'x1':900,'y0':20,'y1':60,'amplitude':10.0})

# And this rotates the cube to face 2 taking the window titled mplayer with us
rotatePlugin = manager.getPlugin('rotate')
rotatePlugin.doAction('rotate_window', {'face':2,'window':'mplayer'})

# The we could maximizing Pidgin's window
corePlugin = manager.getPlugin('core')
corePlugin.doAction('maximize_window', {'window':'Buddy List'})

# Followed by closing Pidgin
corePlugin.doAction('close_window', {'window':'Buddy List'})
--------------------------------------------------------------------------------


GENERAL:
--------------------------------------------------------------------------------
There are two main classes in the module, with the following uses:

class CompizManager()
    Getting plugins:
        getPlugin(self, pluginName)
        - Returns a representation of a Compiz plugin, if Compiz is running.
        
    Doing things with plugins:
        pluginDoAction(self, pluginName, action, parameters=None)
        - Get a plugin to do an action with parameters without having to get 
        - the plugin first. Assuming the plugin is active or you will get an
        - exception.
     
    Plugin management:
        activatePlugin(self, pluginNames)
        - Activates plugins, either takes a single name or tuple of names.
        
        deactivatePlugin(self, pluginNames)
        - Deactivates plugins, takes either a single name or tuple of names.
   
    Fetching information about plugins:
        listAllPlugins(self)
        - Returns a list of all available Compiz plugins (active and inactive).
        
        listActivePlugins(self)
        - Returns a list of currently active Compiz plugins.
        
        listInactivePlugins(self)
        - returns a list of currently inactive Compiz plugins.
        
        setActivePluginList(self, pluginList)
        - Lets you set the list of currently active plugins.

    Fetching information about windows:
        listWindows(self)
        - For now this simply returns a list containing tuples of windows 
        - titles and window id's. Hopefully in the future it will have more 
        - specific details like which viewport or face of the cube, etc, but
        - this is not yet implemented.

class CompizPlugin()
    Option related:
        listOptions()
        - returns a list of available options for the plugin.
        
        getOption( optionName )
        - returns value associated with the option.
        
        setOption( optionName, newValue ) 
        - sets the value of an option. Refer to listOptions() to determine what 
          the type of value is.
        
    Action related:
        listActions()
        - returns a list of available actions for the plugin.
        
        doAction( actionName, args )
        - calls an action. Some actions require arguments which then must be 
          specified. If arguments are required or not can be determined by 
          examining the output of listActions().
        
    Others:
        update()
        - can be used after a plugin has been activated to change it's status 
          and reload it's options and actions from the Dbus.
--------------------------------------------------------------------------------