summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Frank Erikson <kristian@dingey.(none)>2009-03-05 09:00:30 +1300
committerKristian Frank Erikson <kristian@dingey.(none)>2009-03-05 09:00:30 +1300
commit6b41db20abc769206ed80c117bf25413d712d765 (patch)
treeb85d9d5da6908a3540791ed5e5cd2a2d2566c9df
parent41cb12bed864f364df1399d56589ad20f67cb229 (diff)
downloadpython-compiz-manager-master.tar.gz
python-compiz-manager-master.tar.bz2
Adding recent dev updates. Mostly minor stuff.HEADmaster
-rwxr-xr-xCompizConnection.py2
-rw-r--r--CompizError.py2
-rwxr-xr-xCompizManager.py50
-rwxr-xr-xCompizPlugin.py66
-rw-r--r--CompizPyWindowList-setup.py2
-rw-r--r--CompizPyWindowList.c2
-rw-r--r--CompizTests.py52
-rw-r--r--CompizTools.py89
-rw-r--r--README11
-rwxr-xr-xplugins.xml200
10 files changed, 309 insertions, 167 deletions
diff --git a/CompizConnection.py b/CompizConnection.py
index 4fa32e2..5e4ff36 100755
--- a/CompizConnection.py
+++ b/CompizConnection.py
@@ -16,7 +16,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
-# Author: Kristian F. Erikson <kristian@erikson.dk>
+# Author: Kristian F. Erikson <kristian.erikson@eyemagnet.com>
#
import dbus
diff --git a/CompizError.py b/CompizError.py
index c48b261..e2187a5 100644
--- a/CompizError.py
+++ b/CompizError.py
@@ -16,7 +16,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
-# Author: Kristian F. Erikson <kristian@erikson.dk>
+# Author: Kristian F. Erikson <kristian.erikson@eyemagnet.com>
#
diff --git a/CompizManager.py b/CompizManager.py
index 24ce8b1..724b7bd 100755
--- a/CompizManager.py
+++ b/CompizManager.py
@@ -16,19 +16,20 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
-# Author: Kristian F. Erikson <kristian@erikson.dk>
+# Author: Kristian F. Erikson <kristian.erikson@eyemagnet.com>
#
-# I am still new to using python. So you find any code that's not 'good' python
-# please flick me an email so I can correct it :)
-
import dbus
-import xml.etree.ElementTree
+import ElementTree
import time
from CompizPlugin import CompizPlugin # Import the local modules
from CompizConnection import CompizConnection
from CompizTools import *
+from CompizTests import *
+
+pluginXmlLocation = "./plugins.xml"
+#pluginXmlLocation = "/home/apps/eyemagnet/eyemagnet_compiz_manager/plugins.xml"
class CompizManager(object):
"""
@@ -36,7 +37,7 @@ class CompizManager(object):
Compiz Plugins can be managed interactively in Python using this module.
"""
- def __init__(self):
+ def __init__(self, quickBuild = True):
""" Build a compiz manager instance. """
self.connection = CompizConnection()
self.pluginDict = {}
@@ -44,6 +45,7 @@ class CompizManager(object):
self.activePluginList = []
self.active = False
self.connect()
+ self.quickBuild = quickBuild
self.buildPlugins()
def connect(self): # Connects to compiz and gets the list of plugins
@@ -59,7 +61,7 @@ class CompizManager(object):
def buildPlugins(self): # Creates new plugin objects for each of the plugins
""" Internal function that builds the plugins and their options and actions. """
- tree = xml.etree.ElementTree.parse("plugins.xml") # Builds even is Compiz not running
+ tree = ElementTree.parse(pluginXmlLocation) # Builds even is Compiz not running
for pluginName in self.pluginNameList:
plugin = CompizPlugin(pluginName, self)
actionsAndArgs = tree.find(pluginName)
@@ -68,8 +70,13 @@ class CompizManager(object):
def getPlugin(self, pluginName): # Returns specified plugin object (if active)
""" Returns a representation of a Compiz plugin, if Compiz is running. """
- if self.active: return self.pluginDict[pluginName]
+ if self.active:
+ if self.quickBuild:
+ self.pluginDict[pluginName].update()
+ return self.pluginDict[pluginName]
else: raise CompizNotActiveError
+ # Needs new logic so we can still send things even if plugin not loaded
+
def listActivePlugins(self): # List all currently active plugins
""" Returns a list of currently active Compiz plugins. """
@@ -176,8 +183,11 @@ class CompizManager(object):
# Go get the list of windows from the now C extension written specifically
# Implementation using wmctrl source code
- return CompizPyWindowList.listWindows()
-
+ returnedList = CompizPyWindowList.listWindows()
+ # Decode unicode chars correctly first:
+ for window in returnedList:
+ window['title'] = window['title'].decode('utf-8')
+ return returnedList
def AllToScreen():
""" Prints all Plugins with their actions and options to the screen. """
@@ -187,10 +197,10 @@ def AllToScreen():
print("Plugin: " + str(tempPlugin.name) + ' active=' + str(tempPlugin.active))
print("Options:\n" + str(tempPlugin.listOptions()))
print("Actions:\n" + str(tempPlugin.listActions()) + '\n')
-
def AllToFile(fileName):
""" Prints all Plugins with their actions and options to a file. """
+ manager = CompizManager()
listofPlugins = manager.listAllPlugins()
output = open(fileName, 'w')
for plugin in listofPlugins:
@@ -198,13 +208,10 @@ def AllToFile(fileName):
output.write("Plugin: " + str(tempPlugin.name) + ' active=' + str(tempPlugin.active) + '\n')
output.write("Options:\n" + str(tempPlugin.listOptions()) + '\n')
output.write("Actions:\n" + str(tempPlugin.listActions()) + '\n\n')
-
-if __name__ == '__main__':
- # Set a global manager for the tests:
- manager = CompizManager()
-
- from CompizTests import *
+def RunTests():
+ """ Simple function to launch testing of this module """
+ manager = CompizManager()
# Pre test setup
preTestSetup()
# Run the tests
@@ -212,10 +219,9 @@ if __name__ == '__main__':
unittest.TextTestRunner(verbosity=2).run(suite)
# Run the post test cleanup
postTestCleanup()
+
+if __name__ == '__main__':
+ RunTests() # Run the tests
+ AllToFile('Plugins with options and actions.txt') # Print a file with actions and options listed in it
- # Print a file with actions and options listed in it
- AllToFile('Plugins with options and actions.txt')
-
- print "\nWindows currently active:"
- print manager.listWindows()
diff --git a/CompizPlugin.py b/CompizPlugin.py
index ca36d14..c36f1fe 100755
--- a/CompizPlugin.py
+++ b/CompizPlugin.py
@@ -16,7 +16,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
-# Author: Kristian F. Erikson <kristian@erikson.dk>
+# Author: Kristian F. Erikson <kristian.erikson@eyemagnet.com>
#
import dbus
@@ -52,18 +52,25 @@ class CompizPlugin(object):
self.options = {}
self.actions = {}
self.active = False
- self.update()
+ if not self.manager.quickBuild:
+ self.update()
def listOptions(self):
""" Returns a list of available options for the plugin """
- if self.active: # Only return options if we're active
+ if not self.active:
+ if self.manager.quickBuild:
+ self.update()
+ if self.active: # Only return options if we're active
return self.options
else:
return {}
def listActions(self):
""" Returns a list of available actions for the plugin """
- if self.active: # Only return actions if we're active
+ if not self.active:
+ if self.manager.quickBuild:
+ self.update()
+ if self.active: # Only return actions if we're active
return self.actions
else:
return {}
@@ -168,6 +175,7 @@ class CompizPlugin(object):
inActions = actionsXML.getchildren()
for action in inActions:
+
if action.getchildren():
self.actions[action.tag] = {}
for subaction in action.getchildren():
@@ -177,6 +185,9 @@ class CompizPlugin(object):
def setOption(self, optionName, newOptionValue):
""" Sets the value of an option. Refer to listOptions() to determine what the type of value is for an option. """
+ if not self.active:
+ if self.manager.quickBuild:
+ self.update()
if self.active:
if optionName in self.options:
locationString = ''
@@ -208,6 +219,9 @@ class CompizPlugin(object):
def getOption(self, optionName):
""" Returns value associated with the option """
+ if not self.active:
+ if self.manager.quickBuild:
+ self.update()
if self.active:
if optionName in self.options:
locationString = ''
@@ -231,20 +245,20 @@ class CompizPlugin(object):
raise CompizPluginNotActiveError # Raise exception if plugin is not active
def doAction(self, action, arguments = ''): # Takes the name of the action and the arguments in a dict
+ if not self.active:
+ if self.manager.quickBuild:
+ self.update()
""" Calls an action. Some actions require arguments which then must be specified.
If arguments are required can be determined by examining the output of listActions(). """
if self.active:
if action in self.actions:
paramsString = []
-
# Attach root window whenever making a method call
paramsString.append(unicode('root'))
xwininfo = os.popen("xwininfo -root | grep id: | awk '{ print $4 }'")
xwininfoOutput = xwininfo.read()
paramsString.append(int(xwininfoOutput, 16))
-
advancedMethod = False
-
try:
for param in self.actions[action]:
if type(self.actions[action][param]) == type({}):
@@ -253,15 +267,35 @@ class CompizPlugin(object):
# First attach name of parameter
paramsString.append(unicode(param))
if param == 'window': # If param is a window title find id for us
- if self.actions[action][param] == type(arguments[param]): # Check parameters are correct type
- xwininfo = os.popen("xwininfo -name '" + arguments[param] + "' | grep id: | awk '{ print $4 }'")
- xwininfoOutput = xwininfo.read()
- try:
- paramsString.append(int(xwininfoOutput, 16))
- except ValueError:
- raise CompizPluginWindowNotFoundError # If window not found raise exception
- else:
- raise CompizPluginTypeArgError
+ try: # First try see if we're given the id directly
+ if self.actions[action][param] == type(int(arguments['windowid'])): # Check parameters are correct type
+ # paramsString.append(arguments['windowid'])
+ # First check if window exist
+ windowList = self.manager.listWindows() # Use window manager to find id
+ windowFound = False
+ for window in windowList:
+ if window['id'] == arguments['windowid']:
+ paramsString.append(window['id'])
+ windowFound = True
+ if not windowFound:
+ raise CompizPluginWindowNotFoundError # Notify user if window not found
+ else:
+ raise CompizPluginTypeArgError
+ except KeyError: # Now see if we're given the window title
+ try:
+ if type(arguments['windowtitle']) == ( type('hello') or type(u'hello') ): # Check title is a string
+ windowList = self.manager.listWindows() # Use window manager to find id
+ windowFound = False
+ for window in windowList:
+ if window['title'] == unicode(arguments['windowtitle']):
+ paramsString.append(window['id'])
+ windowFound = True
+ if not windowFound:
+ raise CompizPluginWindowNotFoundError # Notify user if window not found
+ else:
+ raise CompizPluginTypeArgError
+ except KeyError:
+ raise CompizPluginTypeArgError
else: # Otherwise go ahead and attach the parameter
if self.actions[action][param] == type(arguments[param]): # Check parameters are correct type
paramsString.append(arguments[param])
diff --git a/CompizPyWindowList-setup.py b/CompizPyWindowList-setup.py
index 9af5d2f..168ac2e 100644
--- a/CompizPyWindowList-setup.py
+++ b/CompizPyWindowList-setup.py
@@ -16,7 +16,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
-# Author: Kristian F. Erikson <kristian@erikson.dk>
+# Author: Kristian F. Erikson <kristian.erikson@eyemagnet.com>
#
# To rebuild this module the command is: ~$ python CompizPyWindowList-setup.py build_ext -i
diff --git a/CompizPyWindowList.c b/CompizPyWindowList.c
index 6381fb4..354ba70 100644
--- a/CompizPyWindowList.c
+++ b/CompizPyWindowList.c
@@ -19,7 +19,7 @@
* This plugin is based on Wmctrl-1.07 by Tomas Styblo and the 1.07-6
* Debian patch by Decklin Foster.
*
- * Author: Kristian F. Erikson <kristian@erikson.dk>
+ * Author: Kristian F. Erikson <kristian.erikson@eyemagnet.com>
*/
#include <Python.h>
diff --git a/CompizTests.py b/CompizTests.py
index 7ce1e28..ed4dc1b 100644
--- a/CompizTests.py
+++ b/CompizTests.py
@@ -16,30 +16,27 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
-# Author: Kristian F. Erikson <kristian@erikson.dk>
+# Author: Kristian F. Erikson <kristian.erikson@eyemagnet.com>
#
import unittest
-from CompizManager import CompizManager
from CompizError import *
from CompizTools import *
+import CompizManager
import time
-
def preTestSetup():
- global manager, waterWasActive, placeWasActive, rotateWasActive
- global zoomWasActive, updateNecessary
-
- manager = CompizManager()
+ global manager, waterWasActive, placeWasActive, rotateWasActive, blurWasActive, updateNecessary
+ manager = CompizManager.CompizManager()
waterPlugin = manager.getPlugin('water') # These plugins must be active: water, place, rotate, core is assumed
placePlugin = manager.getPlugin('place')
rotatePlugin = manager.getPlugin('rotate')
- zoomPlugin = manager.getPlugin('zoom') # This plugin must be inactive: zoom
+ blurPlugin = manager.getPlugin('blur') # This plugin must be inactive: blur - change as not everyone has this plugin!
# Save states so we can set them back later
waterWasActive = waterPlugin.active
placeWasActive = placePlugin.active
rotateWasActive = rotatePlugin.active
- zoomWasActive = zoomPlugin.active
+ blurWasActive = blurPlugin.active
# Ensure states are correct for testing
activePluginsList = manager.listActivePlugins()
updateNecessary = False
@@ -52,8 +49,8 @@ def preTestSetup():
if not rotateWasActive:
activePluginsList.append('rotate')
updateNecessary = True
- if zoomWasActive:
- activePluginsList.remove('zoom')
+ if blurWasActive:
+ activePluginsList.remove('blur')
updateNecessary = True
if updateNecessary:
manager.setActivePluginList(activePluginsList)
@@ -61,17 +58,18 @@ def preTestSetup():
waterPlugin.update()
placePlugin.update()
rotatePlugin.update()
- zoomPlugin.update()
+ blurPlugin.update()
def postTestCleanup():
+ global updateNecessary
# Set plugin states back to what they were
if updateNecessary:
activePluginsList = manager.listActivePlugins()
if not waterWasActive: activePluginsList.remove('water')
if not placeWasActive: activePluginsList.remove('place')
if not rotateWasActive: activePluginsList.remove('rotate')
- if zoomWasActive: activePluginsList.append('zoom')
+ if blurWasActive: activePluginsList.append('blur')
manager.setActivePluginList(activePluginsList)
@@ -125,9 +123,9 @@ class TestCompizManagerClasses(unittest.TestCase):
"Test exceptions are raised if plugins given incorrect type arguments on calling actions."
# Assuming firepaint plugin is active
rotatePlugin = manager.getPlugin('rotate')
- self.assertRaises(CompizPluginWindowNotFoundError, rotatePlugin.doAction, "rotate_window", {'window':'400','face':'200'}) # should be str + int
- self.assertRaises(CompizPluginTypeArgError, rotatePlugin.doAction, "rotate_window", {'window':400,'face':200})
- self.assertRaises(CompizPluginTypeArgError, rotatePlugin.doAction, "rotate_window", {'window':40.0,'face':20.0})
+ self.assertRaises(CompizPluginWindowNotFoundError, rotatePlugin.doAction, "rotate_window", {'windowtitle':'400','face':'200'}) # should be str + int
+ self.assertRaises(CompizPluginTypeArgError, rotatePlugin.doAction, "rotate_window", {'windowtitle':400,'face':200})
+ self.assertRaises(CompizPluginTypeArgError, rotatePlugin.doAction, "rotate_window", {'windowtitle':40.0,'face':20.0})
def testPluginSetOption(self):
"Test the plugin can have their options changed."
@@ -154,17 +152,17 @@ class TestCompizManagerClasses(unittest.TestCase):
def testPluginActionOnInactivePlugin(self):
"Test plugins raise an exceptions if they are inactive and user attempts to use them"
# Assuming benchmark plugin is inactive
- zoomPlugin = manager.getPlugin('zoom')
- self.assertRaises(CompizPluginNotActiveError, zoomPlugin.getOption, "johndoe")
- self.assertRaises(CompizPluginNotActiveError, zoomPlugin.setOption, "johndoe", 250.0)
- self.assertRaises(CompizPluginNotActiveError, zoomPlugin.doAction, "dummy-action")
+ blurPlugin = manager.getPlugin('blur')
+ self.assertRaises(CompizPluginNotActiveError, blurPlugin.getOption, "johndoe")
+ self.assertRaises(CompizPluginNotActiveError, blurPlugin.setOption, "johndoe", 250.0)
+ self.assertRaises(CompizPluginNotActiveError, blurPlugin.doAction, "dummy-action")
def testPluginSetOptionWithLists(self):
- "Test chainging plugin options with lists."
+ "Test changing plugin options with lists."
# First try lists of ints
placePlugin = manager.getPlugin('place')
oldViewportValues = placePlugin.getOption('viewport_x_values')
- placePlugin.setOption('viewport_x_values', [2,2,2])
+ placePlugin.setOption('viewport_x_values', [1,1,1])
newViewportValues = placePlugin.getOption('viewport_x_values')
self.assert_(oldViewportValues != newViewportValues) # Assert the two list are not the same
placePlugin.setOption('viewport_x_values', oldViewportValues)
@@ -206,4 +204,12 @@ class TestCompizManagerClasses(unittest.TestCase):
converted = convertFromDbusToPython(convertsTo) # Now convert the other way
self.assertEquals(convertsTo, converted) # Assert they are the same now
-
+ def testGetListActiveWindow(self):
+ "Test listing active windows and check list looks resonable"
+ windowList = manager.listWindows()
+ for window in windowList:
+ tempTitle = window['title']
+ tempId = window['id']
+ self.assertEquals(type(tempTitle), type(u'hello'))
+ self.assertEquals(type(tempId), type(1))
+
diff --git a/CompizTools.py b/CompizTools.py
index 8a613aa..e531a19 100644
--- a/CompizTools.py
+++ b/CompizTools.py
@@ -16,22 +16,22 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
-# Author: Kristian F. Erikson <kristian@erikson.dk>
+# Author: Kristian F. Erikson <kristian.erikson@eyemagnet.com>
#
import dbus
from CompizError import CompizPluginTypeArgError
def convertFromDbusToTypes(arg):
- if type(arg) == type(dbus.Boolean()):
+ if type(arg) == type(dbus.Boolean(True)):
return type(True) # "<type 'bool'>"
- elif type(arg) == type(dbus.Int32()):
+ elif type(arg) == type(dbus.Int32(1)):
return type(1) # "<type 'int'>"
- elif type(arg) == type(dbus.Double()):
+ elif type(arg) == type(dbus.Double(1.00)):
return type(1.012) # "<type 'float'>"
- elif type(arg) == type(dbus.String()):
+ elif type(arg) == type(dbus.String('Hello')):
return type("Hello World ;)") # "<type 'str'>"
- elif type(arg) == type(dbus.Array()):
+ elif type(arg) == type(dbus.Array([2,4])):
signature = arg.signature # If we get an array see what's inside
if signature == dbus.Signature('b'):
return [type(True)] # "<type 'bool'>" in an arrray
@@ -64,26 +64,26 @@ def convertFromStringToTypes(arg):
def convertFromSimpleDbusToPython(arg):
- if type(arg) == type(dbus.Boolean()):
+ if type(arg) == type(dbus.Boolean(True)):
return bool(arg)
- elif type(arg) == type(dbus.Int32()):
+ elif type(arg) == type(dbus.Int32(1)):
return int(arg)
- elif type(arg) == type(dbus.Double()):
+ elif type(arg) == type(dbus.Double(1.00)):
return float(arg)
- elif type(arg) == type(dbus.String()):
+ elif type(arg) == type(dbus.String("hello")):
return str(arg)
def convertFromDbusToPython(arg):
- if type(arg) == type(dbus.Boolean()):
+ if type(arg) == type(dbus.Boolean(True)):
return bool(arg)
- elif type(arg) == type(dbus.Int32()):
+ elif type(arg) == type(dbus.Int32(1)):
return int(arg)
- elif type(arg) == type(dbus.Double()):
+ elif type(arg) == type(dbus.Double(1.00)):
return float(arg)
- elif type(arg) == type(dbus.String()):
+ elif type(arg) == type(dbus.String("hello")):
return unicode(arg)
- elif type(arg) == type(dbus.Array()):
+ elif type(arg) == type(dbus.Array([2,4])):
signature = arg.signature # If we get an array convert what's inside
arg = list(arg) # First convert to a list
newlist = []
@@ -130,7 +130,7 @@ def convertFromSimplePythonToDbus(arg):
elif type(arg) == type(44.44):
return dbus.Double(arg)
elif type(arg) == type("s") or type(arg) == type('s') or type(arg) == type(unicode('s')):
- return dbus.String(unicode(arg))
+ return dbus.String(arg)
else:
raise CompizPluginTypeArgError
@@ -145,33 +145,36 @@ def convertFromPythonToDbus(arg):
elif type(arg) == (type("s") or type('s') or type(unicode('s'))):
return dbus.String(unicode(arg))
elif type(arg) == type([]) or type(arg) == type((1,2)):
- signature = convertPythonToDbusSignature(arg[0])
- newlist = []
- if signature == dbus.Signature('b'): # Convert each item on the list
- for item in arg:
- if type(item) == type(True): # Type check each item as well
- newlist.append(convertFromSimplePythonToDbus(item))
- else:
- raise CompizPluginTypeArgError
- elif signature == dbus.Signature('i'):
- for item in arg:
- if type(item) == type(123):
- newlist.append(convertFromSimplePythonToDbus(item))
- else:
- raise CompizPluginTypeArgError
- elif signature == dbus.Signature('d'):
- for item in arg:
- if type(item) == type(23.12):
- newlist.append(convertFromSimplePythonToDbus(item))
- else:
- raise CompizPluginTypeArgError
- elif signature == dbus.Signature('s'):
- for item in arg:
- if type(item) == type("s") or type(item) == type('s') or type(item) == type(unicode('s')):
- newlist.append(convertFromSimplePythonToDbus(item))
- else:
- raise CompizPluginTypeArgError
- return dbus.Array(newlist, signature)
+ try:
+ signature = convertPythonToDbusSignature(arg[0])
+ newlist = []
+ if signature == dbus.Signature('b'): # Convert each item on the list
+ for item in arg:
+ if type(item) == type(True): # Type check each item as well
+ newlist.append(convertFromSimplePythonToDbus(item))
+ else:
+ raise CompizPluginTypeArgError
+ elif signature == dbus.Signature('i'):
+ for item in arg:
+ if type(item) == type(123):
+ newlist.append(convertFromSimplePythonToDbus(item))
+ else:
+ raise CompizPluginTypeArgError
+ elif signature == dbus.Signature('d'):
+ for item in arg:
+ if type(item) == type(23.12):
+ newlist.append(convertFromSimplePythonToDbus(item))
+ else:
+ raise CompizPluginTypeArgError
+ elif signature == dbus.Signature('s'):
+ for item in arg:
+ if type(item) == type("s") or type(item) == type('s') or type(item) == type(unicode('s')):
+ newlist.append(convertFromSimplePythonToDbus(item))
+ else:
+ raise CompizPluginTypeArgError
+ return dbus.Array(newlist, signature)
+ except IndexError: # In case we need to convert an empty list
+ return dbus.Array([], dbus.Signature('s')) # Guessing it's ok to return empty array with a string signature
else:
raise CompizPluginTypeArgError # Unsupported type
diff --git a/README b/README
index 884b45f..cce49f5 100644
--- a/README
+++ b/README
@@ -21,8 +21,8 @@ You can do this by going to the folder where this file in located and using:
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.
+'include_dirs' match on your machine. Intructions for doing this are
+described in CompizPyWindowList-setup.py.
--------------------------------------------------------------------------------
@@ -39,17 +39,16 @@ 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'})
+rotatePlugin.doAction('rotate_window', {'face':2,'windowtitle':'mplayer'})
# The we could maximizing Pidgin's window
corePlugin = manager.getPlugin('core')
-corePlugin.doAction('maximize_window', {'window':'Buddy List'})
+corePlugin.doAction('maximize_window', {'windowtitle':'Buddy List'})
# Followed by closing Pidgin
-corePlugin.doAction('close_window', {'window':'Buddy List'})
+corePlugin.doAction('close_window', {'windowtitle':'Buddy List'})
--------------------------------------------------------------------------------
-
GENERAL:
--------------------------------------------------------------------------------
There are two main classes in the module, with the following uses:
diff --git a/plugins.xml b/plugins.xml
index f4d8b87..bbe6429 100755
--- a/plugins.xml
+++ b/plugins.xml
@@ -16,9 +16,13 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
- Author: Kristian F. Erikson <kristian@erikson.dk>
+ Author: Kristian F. Erikson <kristian.erikson@eyemagnet.com>
-->
<compiz-plugin>
+ <!--<3d/>--> <!-- no parameters found - 2009-02-19 -->
+ <addhelper/> <!-- no parameters found - 2009-02-19 -->
+ <animation/> <!-- no parameters found - 2009-02-19 -->
+ <animationaddon/> <!-- no parameters found - 2009-02-19 -->
<annotate>
<draw><!-- slant options are: oblique, italic, normal --><!-- weight options are: bold, normal -->
<rectangle tool="string" x="double" y="double" w="double" h="double" /> <!-- ??? TODO: revisit all of these. Does not appear to work-->
@@ -27,86 +31,155 @@
<text tool="string" text="string" x="double" y="double" family="string" size="double" slant="string" weight="string" />
</draw>
</annotate>
+ <bench/> <!-- no parameters found - 2009-02-19 -->
+ <bicubic/> <!-- no parameters found - 2009-02-19 -->
<blur>
<!-- pulse locks window as permanently blurred, not what name would indicate... -->
- <pulse window="string" /> <!-- tested and working - 2008-12-16 -->
+ <pulse window="int" /> <!-- tested and working - 2008-12-16 -->
</blur>
<clone>
<initiate x="int" y="int"/> <!-- untested -->
</clone>
+ <colorfilter>
+ <toggle_window window="int" /> <!-- tested and working - 2009-02-19 -->
+ </colorfilter>
<core>
- <close_window window="string" /> <!-- tested and working - 2008-12-16 -->
- <minimize_window window="string" /> <!-- tested and working - 2008-12-16 -->
- <lower_window window="string" /> <!-- tested and working - 2008-12-16 -->
- <raise_window window="string" /> <!-- tested and working - 2008-12-16 -->
- <toggle_window_shaded window="string" /> <!-- tested and working - 2008-12-16 -->
- <maximize_window_horizontally window="string" /> <!-- tested and working - 2008-12-16 -->
- <maximize_window_vertically window="string" /> <!-- tested and working - 2008-12-16 -->
- <toggle_window_maximized_horizontally window="string" /><!-- tested and working - 2008-12-16 -->
- <toggle_window_maximized_vertically window="string" /> <!-- tested and working - 2008-12-16 -->
- <toggle_window_maximized window="string" /> <!-- tested and working - 2008-12-16 -->
- <window_menu window="string" /> <!-- tested and working - 2008-12-16 -->
- <maximize_window window="string" /> <!-- tested and working - 2008-12-16 -->
- <unmaximize_window window="string" /> <!-- tested and working - 2008-12-16 -->
+ <close_window window="int" /> <!-- tested and working - 2008-12-16 -->
+ <minimize_window window="int" /> <!-- tested and working - 2008-12-16 -->
+ <lower_window window="int" /> <!-- tested and working - 2008-12-16 -->
+ <raise_window window="int" /> <!-- tested and working - 2008-12-16 -->
+ <toggle_window_shaded window="int" /> <!-- tested and working - 2008-12-16 -->
+ <maximize_window_horizontally window="int" /> <!-- tested and working - 2008-12-16 -->
+ <maximize_window_vertically window="int" /> <!-- tested and working - 2008-12-16 -->
+ <toggle_window_maximized_horizontally window="int" /><!-- tested and working - 2008-12-16 -->
+ <toggle_window_maximized_vertically window="int" /> <!-- tested and working - 2008-12-16 -->
+ <toggle_window_maximized window="int" /> <!-- tested and working - 2008-12-16 -->
+ <window_menu window="int" /> <!-- tested and working - 2008-12-16 -->
+ <maximize_window window="int" /> <!-- tested and working - 2008-12-16 -->
+ <unmaximize_window window="int" /> <!-- tested and working - 2008-12-16 -->
</core>
- <cube/> <!-- no parameters found - 2008-12-16 -->
- <dbus/> <!-- no parameters found - 2008-12-16 -->
- <decoration/> <!-- no parameters found - 2008-12-16 -->
+ <crashhandler/> <!-- no parameters found - 2009-02-19 -->
+ <cube/> <!-- no parameters found - 2008-12-16 -->
+ <cubeaddon/> <!-- no parameters found - 2009-02-19 -->
+ <dbus/> <!-- no parameters found - 2008-12-16 -->
+ <decoration/> <!-- no parameters found - 2008-12-16 -->
+ <expo/> <!-- no parameters found - 2008-02-19 -->
<extrawm>
- <activate window="string" /> <!-- tested and working - 2008-12-16 -->
- <activate_demands_attention window="string" /> <!-- ??? TODO: revisit -->
- <toggle_always_on_top window="string" /> <!-- tested and working - 2008-12-16 -->
- <toggle_sticky window="string" /> <!-- ??? TODO: revisit -->
- <toggle_redirect window="string" /> <!-- ??? TODO: revisit -->
- <toggle_fullscreen window="string" /> <!-- tested and working - 2008-12-16 -->
+ <activate window="int" /> <!-- tested and working - 2008-12-16 -->
+ <activate_demands_attention window="int" /> <!-- ??? TODO: revisit -->
+ <toggle_always_on_top window="int" /> <!-- tested and working - 2008-12-16 -->
+ <toggle_sticky window="int" /> <!-- ??? TODO: revisit -->
+ <toggle_redirect window="int" /> <!-- ??? TODO: revisit -->
+ <toggle_fullscreen window="int" /> <!-- tested and working - 2008-12-16 -->
</extrawm>
- <fade></fade> <!-- no parameters found - 2008-12-16 -->
+ <ezoom>
+ <set_zoom_area x1="int" y1="int" x2="int" y2="int" scale="bool" restrain="bool" /> <!-- ??? TODO: revisit -->
+ <fit_to_window window="int" /> <!-- tested and working - 2009-02-19 -->
+ <fit_to_zoom window="int" /> <!-- tested and working - 2009-02-19 -->
+ </ezoom>
+ <greenscreen>
+ <toggle_window window="int" /> <!-- tested and working - 2009-02-19 -->
+ </greenscreen>
+ <fade/> <!-- no parameters found - 2008-12-16 -->
+ <fadedesktop/> <!-- no parameters found - 2009-02-19 -->
<firepaint>
<add_particle x="double" y="double" />
</firepaint>
+ <gears/> <!-- no parameters found - 2009-02-19 -->
+ <gconf/> <!-- no parameters found - 2009-02-19 -->
<glib/> <!-- no parameters found - 2008-12-16 -->
+ <group/> <!-- no useful parameters found - 2009-02-19 -->
<ini/> <!-- no parameters found - 2008-12-16 -->
<inotify/> <!-- no parameters found - 2008-12-16 -->
+ <jpeg/> <!-- no parameters found - 2009-02-19 -->
+ <loginout/> <!-- no parameters found - 2009-02-19 -->
+ <mag>
+ <initiate factor="double" /> <!-- tested and working - 2008-12-16 - Factor does appear to change anything though -->
+ </mag>
+ <maximumize>
+ <trigger_min window="int" /> <!-- tested and working - 2009-02-19 -->
+ <trigger_max window="int" /> <!-- tested and working, probably, just not sure what it does? - 2009-02-19 -->
+ </maximumize>
+ <mblur/> <!-- no parameters found - 2009-02-19 -->
<minimize/> <!-- no parameters found - 2008-12-16 -->
+ <mousepoll/> <!-- no parameters found - 2009-02-19 -->
<move>
- <initiate window="string" /> <!-- tested and working - 2008-12-16 - There are also x,y,button and direction but skipping them.-->
+ <initiate window="int" /> <!-- tested and working - 2008-12-16 - There are also x,y,button and direction but skipping them.-->
</move>
<neg>
- <window_toggle window="string" /> <!-- tested and working - 2008-12-16 -->
+ <window_toggle window="int" /> <!-- tested and working - 2008-12-16 -->
</neg>
+ <notification/> <!-- no parameters found - 2009-02-19 -->
<obs>
- <brightness_increase window="string" /> <!-- tested and working - 2008-12-16 -->
- <brightness_decrease window="string" /> <!-- tested and working - 2008-12-16 -->
- <saturation_increase window="string" /> <!-- tested and working - 2008-12-16 -->
- <opacity_decrease window="string" /> <!-- tested and working - 2008-12-16 -->
- <opacity_increase window="string" /> <!-- tested and working - 2008-12-16 -->
- <saturation_decrease window="string" /> <!-- tested and working - 2008-12-16 -->
+ <brightness_increase window="int" /> <!-- tested and working - 2008-12-16 -->
+ <brightness_decrease window="int" /> <!-- tested and working - 2008-12-16 -->
+ <saturation_increase window="int" /> <!-- tested and working - 2008-12-16 -->
+ <opacity_decrease window="int" /> <!-- tested and working - 2008-12-16 -->
+ <opacity_increase window="int" /> <!-- tested and working - 2008-12-16 -->
+ <saturation_decrease window="int" /> <!-- tested and working - 2008-12-16 -->
</obs>
+ <opacify/> <!-- no parameters found - 2009-02-19 -->
<place/> <!-- no parameters found - 2008-12-16 -->
<png/> <!-- no parameters found - 2008-12-16 -->
+ <put>
+ <put_put window="int" x="int" y="int" face="int" /> <!-- not working - 2009-02-19 -->
+ <put_viewport window="int" face="int" /> <!-- not working - 2009-02-19 -->
+ <put_viewport_1 window="int" /> <!-- these works sort of... - 2009-02-19 -->
+ <put_viewport_2 window="int" />
+ <put_viewport_3 window="int" />
+ <put_viewport_4 window="int" />
+ <put_viewport_5 window="int" />
+ <put_viewport_6 window="int" />
+ <put_viewport_7 window="int" />
+ <put_viewport_8 window="int" />
+ <put_viewport_9 window="int" />
+ <put_viewport_10 window="nt" />
+ <put_viewport_11 window="int" />
+ <put_viewport_12 window="int" />
+ <put_center window="int" />
+ <put_bottomleft window="int" />
+ <put_bottomright window="int" />
+ <put_next_output window="int" />
+ <put_viewport_right window="int" />
+ <put_viewport_up window="int" />
+ <put_viewport_down window="int" />
+ <put_topleft window="int" />
+ <put_left window="int" />
+ <put_put window="int" />
+ <put_bottom window="int" />
+ <put_restore window="int" />
+ <put_pointer window="int" />
+ <put_right window="int" />
+ <put_topright window="int" />
+ <put_viewport_left window="int" />
+ <put_top window="int" />
+ </put>
+ <reflex/> <!-- no parameters found - 2009-02-19 -->
<regex/> <!-- no parameters found - 2008-12-16 -->
<resize>
- <initiate_rectangle window="string" /> <!-- tested and working - 2008-12-16 - There are also x,y,button -->
- <initiate_normal window="string" /> <!-- tested and working - 2008-12-16 - and direction but skipping them.-->
- <initiate_stretch window="string" /> <!-- tested and working - 2008-12-16 - as they don't really make sense -->
- <initiate_outline window="string" /> <!-- tested and working - 2008-12-16 - it terms of being assignable. -->
- <initiate window="string" /> <!-- tested and working - 2008-12-16 -->
+ <initiate_rectangle window="int" /> <!-- tested and working - 2008-12-16 - There are also x,y,button -->
+ <initiate_normal window="int" /> <!-- tested and working - 2008-12-16 - and direction but skipping them.-->
+ <initiate_stretch window="int" /> <!-- tested and working - 2008-12-16 - as they don't really make sense -->
+ <initiate_outline window="int" /> <!-- tested and working - 2008-12-16 - it terms of being assignable. -->
+ <initiate window="int" /> <!-- tested and working - 2008-12-16 -->
</resize>
+ <resizeinfo/> <!-- no parameters found - 2009-02-19 -->
+ <ring/> <!-- found a window param but skipping as it makes little sense to have it - 2009-02-19 -->
<rotate>
- <rotate_to_1_window window="string" /> <!-- tested and working - 2008-12-16 -->
- <rotate_to_2_window window="string" /> <!-- tested and working - 2008-12-16 -->
- <rotate_to_3_window window="string" /> <!-- tested and working - 2008-12-16 -->
- <rotate_to_4_window window="string" /> <!-- tested and working - 2008-12-16 -->
- <rotate_to_5_window window="string" /> <!-- tested and working - 2008-12-16 -->
- <rotate_to_6_window window="string" /> <!-- tested and working - 2008-12-16 -->
- <rotate_to_7_window window="string" /> <!-- tested and working - 2008-12-16 -->
- <rotate_to_8_window window="string" /> <!-- tested and working - 2008-12-16 -->
- <rotate_to_9_window window="string" /> <!-- tested and working - 2008-12-16 -->
- <rotate_to_10_window window="string" /> <!-- tested and working - 2008-12-16 -->
- <rotate_to_11_window window="string" /> <!-- tested and working - 2008-12-16 -->
- <rotate_to_12_window window="string" /> <!-- tested and working - 2008-12-16 -->
+ <rotate_to_1_window window="int" /> <!-- tested and working - 2008-12-16 -->
+ <rotate_to_2_window window="int" /> <!-- tested and working - 2008-12-16 -->
+ <rotate_to_3_window window="int" /> <!-- tested and working - 2008-12-16 -->
+ <rotate_to_4_window window="int" /> <!-- tested and working - 2008-12-16 -->
+ <rotate_to_5_window window="int" /> <!-- tested and working - 2008-12-16 -->
+ <rotate_to_6_window window="int" /> <!-- tested and working - 2008-12-16 -->
+ <rotate_to_7_window window="int" /> <!-- tested and working - 2008-12-16 -->
+ <rotate_to_8_window window="int" /> <!-- tested and working - 2008-12-16 -->
+ <rotate_to_9_window window="int" /> <!-- tested and working - 2008-12-16 -->
+ <rotate_to_10_window window="int" /> <!-- tested and working - 2008-12-16 -->
+ <rotate_to_11_window window="int" /> <!-- tested and working - 2008-12-16 -->
+ <rotate_to_12_window window="int" /> <!-- tested and working - 2008-12-16 -->
<rotate_to face="int" /> <!-- tested and working - 2008-12-16 -->
- <rotate_window window="string" face="int" /> <!-- tested and working - 2008-12-16 -->
+ <rotate_window window="int" face="int" /> <!-- tested and working - 2008-12-16 -->
</rotate>
<scale>
<initiate_all match="string" /> <!-- tested and working - 2008-12-16 -->
@@ -114,19 +187,40 @@
<initiate_group match="string" /> <!-- ??? TODO: revisit -->
<initiate match="string" /> <!-- tested and working - 2008-12-16 -->
</scale>
+ <scalefilter/> <!-- no parameters found - 2009-02-19 -->
+ <scaleaddon/> <!-- no parameters found - 2009-02-19 -->
<screenshot/> <!-- no parameters found - 2008-12-16 -->
+ <session/> <!-- no useful parameters found - 2009-02-19 -->
+ <shift/> <!-- no useful parameters found - 2009-02-19 -->
+ <shelf/> <!-- no parameters found - 2009-02-19 -->
+ <showmouse/> <!-- no parameters found - 2009-02-19 -->
+ <snap/> <!-- no useful parameters found - 2009-02-19 -->
+ <splash/> <!-- no parameters found - 2009-02-19 -->
+ <squeeze>
+ <activate window="int" /> <!-- tested and working - 2009-02-03 -->
+ </squeeze>
+ <staticswitcher/> <!-- no useful parameters found - 2009-02-19 -->
<svg>
- <set window="string" x0="int" y0="int" x1="int" y1="int" gravity0="int" gravity1="int" data="string"/> <!-- Untested TODO - 2008-12-16 -->
+ <set window="int" x0="int" y0="int" x1="int" y1="int" gravity0="int" gravity1="int" data="string"/> <!-- Untested TODO - 2008-12-16 -->
</svg>
<switcher/> <!-- no parameters found - 2008-12-16 -->
+ <text/> <!-- no parameters found - 2009-02-19 -->
+ <thumbnail/> <!-- no parameters found - 2009-02-19 -->
+ <trailfocus/> <!-- no parameters found - 2009-02-19 -->
<video/> <!-- no parameters found - 2008-12-16 -->
+ <vpswitch/> <!-- no parameters found - 2009-02-19 -->
+ <wall/> <!-- no useful parameters found - 2009-02-19 -->
+ <wallpaper/> <!-- no parameters found - 2009-02-19 -->
<water>
<point amplitude="double" x="int" y="int" /> <!-- tested and working - 2008-12-16 -->
<line amplitude="double" x0="int" x1="int" y0="int" y1="int" /> <!-- tested and working - 2008-12-16 -->
</water>
+ <widget/> <!-- no parameters found - 2009-02-19 -->
+ <winrules/> <!-- no parameters found - 2009-02-19 -->
<wobbly>
- <shiver window="string" /> <!-- tested and working - 2008-12-16 -->
+ <shiver window="int" /> <!-- tested and working - 2008-12-16 -->
</wobbly>
<zoom/> <!-- no parameters found - 2008-12-16 -->
+ <workarounds/> <!-- no parameters found - 2009-02-19 -->
</compiz-plugin>