RYX
April 26th, 2007, 07:47 PM
Hello everybody!
This is the first version of the compizutil-library for python - it greatly simplifies accessing compiz over an unlimited number of different backends and offers a higher-level interface for working with compiz, its plugins and its options - in an OOP-like way. The package also contains a useful tool called 'compiztool' which allows editing compiz's basic configuration and settings from the commandline. The compiztool is also an example for how to use the compizutil-library.
A quote from the README:This library is aimed at providing classes and objects that simplify
working with compiz over various backends. The Compiz-class itself
provides a nice, higher-level, object-oriented interface to compiz,
while entirely hiding the abstracted communication-backends.
The average user (i.e. python-coder) may most likely want to work
with the simplified frontend-classes like Compiz, CompizPlugin
or the CompizOption-subclasses. However - more advanced users are
still free to directly access the backend to get to a lower level.
You can directly access the Backend Compiz.backend and use its
common functions.
The docs/examples-directory contains some examples of how to use the
compizutil-library. The bin/compiztool is a tiny "real-world" tool that
gets installed globally and can be quite handy for testing and/or playing.
DOWNLOAD: http://www.ryxperience.com/compiz/compizutil/python-compizutil-0.0.1.tar.gz
(NOTE: This has only been tested on python2.5 and you will need the latest dbus-bindings for python, in Feisty everything should be installed by default)
See the README for some additional info. See the docs/examples-dir for some example-scripts that explain most aspects of compizutil. There is only a dbus-backend yet, so maybe someone likes to write an ini- or gconf-backend?
Some examples:
Get all active plugins from compiz and output each plugins' shortDesc:plugins = Compiz.get_active_plugins()
for plugin in plugins:
print plugin.shortDesc
Get single option from a plugin and get its value:plugin = Compiz.get_plugin('decoration')
if plugin and plugin.is_active():
opt = plugin.get_option('shadow_color')
if opt:
print opt.get_value()
(De-)Activate a plugin:Compiz.deactivate_plugin('cube')
Compiz.activate_plugin('plane')
Get single option from a plugin and set its value:plugin = Compiz.get_plugin('decoration')
if plugin and plugin.is_active():
opt = plugin.get_option('shadow_color')
if opt:
opt.set_value('#ff0000ff')
I'd be happy about any comments, suggestions and bug-reports. This lib should go into our git-repo as soon as possible so many people can start working on (and with) it.
:)
This is the first version of the compizutil-library for python - it greatly simplifies accessing compiz over an unlimited number of different backends and offers a higher-level interface for working with compiz, its plugins and its options - in an OOP-like way. The package also contains a useful tool called 'compiztool' which allows editing compiz's basic configuration and settings from the commandline. The compiztool is also an example for how to use the compizutil-library.
A quote from the README:This library is aimed at providing classes and objects that simplify
working with compiz over various backends. The Compiz-class itself
provides a nice, higher-level, object-oriented interface to compiz,
while entirely hiding the abstracted communication-backends.
The average user (i.e. python-coder) may most likely want to work
with the simplified frontend-classes like Compiz, CompizPlugin
or the CompizOption-subclasses. However - more advanced users are
still free to directly access the backend to get to a lower level.
You can directly access the Backend Compiz.backend and use its
common functions.
The docs/examples-directory contains some examples of how to use the
compizutil-library. The bin/compiztool is a tiny "real-world" tool that
gets installed globally and can be quite handy for testing and/or playing.
DOWNLOAD: http://www.ryxperience.com/compiz/compizutil/python-compizutil-0.0.1.tar.gz
(NOTE: This has only been tested on python2.5 and you will need the latest dbus-bindings for python, in Feisty everything should be installed by default)
See the README for some additional info. See the docs/examples-dir for some example-scripts that explain most aspects of compizutil. There is only a dbus-backend yet, so maybe someone likes to write an ini- or gconf-backend?
Some examples:
Get all active plugins from compiz and output each plugins' shortDesc:plugins = Compiz.get_active_plugins()
for plugin in plugins:
print plugin.shortDesc
Get single option from a plugin and get its value:plugin = Compiz.get_plugin('decoration')
if plugin and plugin.is_active():
opt = plugin.get_option('shadow_color')
if opt:
print opt.get_value()
(De-)Activate a plugin:Compiz.deactivate_plugin('cube')
Compiz.activate_plugin('plane')
Get single option from a plugin and set its value:plugin = Compiz.get_plugin('decoration')
if plugin and plugin.is_active():
opt = plugin.get_option('shadow_color')
if opt:
opt.set_value('#ff0000ff')
I'd be happy about any comments, suggestions and bug-reports. This lib should go into our git-repo as soon as possible so many people can start working on (and with) it.
:)