View Full Version : Where is the widget plugin?
adamk
July 23rd, 2007, 01:19 PM
I can't seem to locate the plugin anywhere. It's not listed here: http://gitweb.opencompositing.org/
I have screenlets working, but I'd like to try it with the widget plugin. Can someone point me in the right direction? Thanks.
Adam
RYX
July 23rd, 2007, 02:21 PM
The old (C-based) widget-plugin is really outdated and buggy (and one big design flaw). There is a way better python-version of a widget-plugin. You'll need to install mikedee's python-plugin first, then you can use the python-based widget-plugin.
Mike's widget-plugin adds regex-matching for widgets so you can use any other plugin and have its effects applied only to widget-windows (using the common match-interface e.g. "type=Widget") ...
Maybe someone likes to write a C-version of it to have it installed by default with the fusion-plugins (there are already 60 plugins installed, so one more doesn't make it worse, does it?) ;) ...
:)
RYX
July 25th, 2007, 02:05 AM
In case someone is interested, I have updated Mike's python-based widget plugin to work with the latest version. It is not perfect yet, but at least it doesn't crash. To use it, you need to load the python-pluginloader-plugin first. Then you activate "pywidget2" like any other plugin. Now you can use the "widget=1" match-expression in all plugins that support window-matching (e.g. animation, fade, ...) and apply certain effects only to your widget-windows (currently only the screenlets support this ;)).
Another cool thing about scripted plugins is that you can simply post them like this: :)
pywidget2.py
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import compiz
class pywidget2Plugin (compiz.CompPlugin):
# meta-/info
name = "pywidget2"
apiVersion = 5
# options
brightness = 0.75
# init function
def init (self):
self.displayOptions = [
compiz.CompMetadataOptionInfo (
name = 'widget_toggle',
type = 'action',
initiate = (self, "widgetToggle")),
compiz.CompMetadataOptionInfo (
name = 'brightness',
type = 'float'),
]
return True
# toggle show-widget state
def widgetToggle (self, d, action, state, options):
s = d.findScreen(options.dict['root'].value)
w = d.findWindow(options.dict['window'].value)
if s:
sPriv = s.getPrivateData(self)
sPriv['active'] = not sPriv['active']
for w in s:
if w.getXAttr("_COMPIZ_WIDGET"):
if sPriv['active']:
w.map()
if not win.isAbove():
win.raiseWindow()
else:
w.unmap()
s.damage()
return True
def widgetMatchHandler (self, d, w, data):
wPriv = w.getPrivateData(self)
isWidget = w.getXAttr("_COMPIZ_WIDGET")
if isWidget and int(data):
return True
return False
def setDisplayOption (self, d, name, value):
if name == 'brightness':
print "Setting brightness in pywidget2-plugin to %f." % value
self.brightness = value
return True
def initDisplay (self, d):
d.registerMatchHandler("widget=", self.widgetMatchHandler)
return True
def finiDisplay (self, d):
return
def initWindow (self, w):
wPriv = w.getPrivateData(self)
wPriv['is_widget'] = False
return True
def finiWindow (self, w):
return
def widgetPaintWindow (self, w, attrib, transform, region, mask):
sPriv = w.screen.getPrivateData(self)
if sPriv['active']:
if not w.getXAttr("_COMPIZ_WIDGET"):
attrib.brightness = int(self.brightness * float(compiz.BRIGHT))
w.screen.unwrap(compiz.PaintWindow)
ret = w.screen.paintWindow(w, attrib, transform, region, mask)
w.screen.wrap(compiz.PaintWindow, self, "widgetPaintWindow")
return ret
def initScreen (self, s):
sPriv = s.getPrivateData(self)
sPriv['active'] = False
s.wrap(compiz.PaintWindow, self, "widgetPaintWindow")
return True
def finiScreen (self, s):
s.unwrap(compiz.PaintWindow)
pywidget2.xml<?xml version="1.0" encoding="UTF-8"?>
<compiz>
<plugin name="pywidget2">
<short>Widget2 (python)</short>
<long>Widget2 (python)</long>
<deps>
<relation type="after">
<plugin>python</plugin>
</relation>
</deps>
<display>
<option type="action" name="widget_toggle">
<short>Hide/Show widgets</short>
<long>Move one viewport to the right</long>
<allowed key="true" button="true" />
<default>
<key>F9</key>
</default>
</option>
<option type="float" name="brightness">
<default>0.3</default>
<min>0.0</min>
<max>1.0</max>
<precision>0.01</precision>
</option>
</display>
</plugin>
</compiz>
:)
adamk
July 25th, 2007, 02:02 PM
Can you point me towards python-pluginloader-plugin ? :-) Google isn't showing anything when I search for that.
Adam
watkin5
July 25th, 2007, 02:10 PM
http://forum.compiz.org/viewtopic.php?t=814&postdays=0&postorder=asc&start=0
git-clone git://people.freedesktop.org/~mike/python
adamk
July 25th, 2007, 02:15 PM
Thanks :-) I'll let you know how I make out.
Adam
adamk
July 25th, 2007, 02:25 PM
So I have the python plugin loader installed, and I have it enabled in ccsm. I have pywidget2.py installed in ~/.compiz/plugins. Even when I restart compiz, though, the widget plugin doesn't show up in ccsm. I'll keep fighting with it when I have a chance, I guess.
Adam
RYX
July 25th, 2007, 03:34 PM
It can be a problem with ccsm because it isn't aware of the python-plugins (python-plugins usually have no metadata file and ccsm can't find them because it only looks for metadata instead of requesting the plugins-list through dbus (as it should)).
You could simply edit the active_plugins-option and add "python" and "pywidget2", but I am afraid you have to edit the ccs-config file which isn't very user-friendly (ugly format). Maybe you should inform the author(s) of ccsm that it would be nice if they would make python-based plugins available through the gui.
btw: The pyhtonloader crashes when you unload it (i.e. whenever you unload a plugin that is listed before it - so all your usual plugins) ... Mike is still working on that problem. It is only an unload-problem, the plugin itself is very stable.
:)
adamk
July 25th, 2007, 04:45 PM
I've opened up a bug for ccsm:
http://bugs.opencompositing.org/show_bug.cgi?id=259
RYX
July 25th, 2007, 06:14 PM
If someone uses gconf as backend he can apply this schema file with "gconftool-2 --install-schema-file=pywidget2.schema" (I stripped out the translation for now):
pywidget2.schema
<gconfschemafile>
<schemalist>
<schema>
<key>/schemas/apps/compiz/plugins/pywidget2/info</key>
<applyto>/apps/compiz/plugins/pywidget2/info</applyto>
<owner>compiz</owner>
<type>string</type>
<default></default>
<locale name="C">
<short>Widget layer in python</short>
<long>Widget layer in python</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/compiz/plugins/pywidget2/load_before</key>
<applyto>/apps/compiz/plugins/pywidget2/load_before</applyto>
<owner>compiz</owner>
<type>list</type>
<list_type>string</list_type>
<default>[]</default>
<locale name="C">
<short>Plugins that this must load before</short>
<long>Do not modify</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/compiz/plugins/pywidget2/requires</key>
<applyto>/apps/compiz/plugins/pywidget2/requires</applyto>
<owner>compiz</owner>
<type>list</type>
<list_type>string</list_type>
<default>[]</default>
<locale name="C">
<short>Plugins that this requires</short>
<long>Do not modify</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/compiz/plugins/pywidget2/allscreens/options/activate_key</key>
<applyto>/apps/compiz/plugins/pywidget2/allscreens/options/activate_key</applyto>
<owner>compiz</owner>
<type>string</type>
<default>F9</default>
<locale name="C">
<short>Activate the widget layer</short>
<long>Activate the widget layer</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/compiz/plugins/pywidget2/allscreens/options/activate_button</key>
<applyto>/apps/compiz/plugins/pywidget2/allscreens/options/activate_button</applyto>
<owner>compiz</owner>
<type>string</type>
<default>Disabled</default>
<locale name="C">
<short>Activate the widget layer</short>
<long>Activate the widget layer</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/compiz/plugins/pywidget2/allscreens/options/activate_bell</key>
<applyto>/apps/compiz/plugins/pywidget2/allscreens/options/activate_bell</applyto>
<owner>compiz</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Activate the widget layer</short>
<long>Activate the widget layer</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/compiz/plugins/pywidget2/allscreens/options/activate_edge</key>
<applyto>/apps/compiz/plugins/pywidget2/allscreens/options/activate_edge</applyto>
<owner>compiz</owner>
<type>list</type>
<list_type>string</list_type>
<default>[]</default>
<locale name="C">
<short>Activate the widget layer</short>
<long>Activate the widget layer (Left, Right, Top, Bottom, TopLeft, TopRight, BottomLeft, BottomRight)</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/compiz/plugins/pywidget2/allscreens/options/activate_edgebutton</key>
<applyto>/apps/compiz/plugins/pywidget2/allscreens/options/activate_edgebutton</applyto>
<owner>compiz</owner>
<type>int</type>
<default>0</default>
<locale name="C">
<short>Activate the widget layer</short>
<long>Activate the widget layer</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/compiz/plugins/pywidget2/allscreens/options/brightness</key>
<applyto>/apps/compiz/plugins/pywidget2/allscreens/options/brightness</applyto>
<owner>compiz</owner>
<type>float</type>
<default>0.25</default>
<locale name="C">
<short>Brightness of blend effect</short>
<long>Brightness of blend effect</long>
</locale>
</schema>
</schemalist>
</gconfschemafile>
The brightness-setting currently not works.
RYX
July 25th, 2007, 06:59 PM
Updated the plugin code a bit. Setting the brightness now works, too.
:)
adamk
July 26th, 2007, 06:50 PM
FYI, this bug was also closed with the remark: "Thats not a problem of ccsm, but how the python plugins work."
http://bugs.opencompositing.org/show_bug.cgi?id=259
I did inquire further about this.
Adam
maluze
July 27th, 2007, 10:46 PM
http://forum.compiz.org/viewtopic.php?t=814&postdays=0&postorder=asc&start=0
git-clone git://people.freedesktop.org/~mike/python
When I try to use git-clone i get this error message:
fatal: unable to connect a socket (Connection timed out)
fetch-pack from 'git://people.freedesktop.org/~mike/python' failed.
I really would like to try a new widget plugin as the current one doesnt work at all for me =/
[/code]
RYX
July 27th, 2007, 10:58 PM
FYI, this bug was also closed with the remark: "Thats not a problem of ccsm, but how the python plugins work."
http://bugs.opencompositing.org/show_bug.cgi?id=259
I did inquire further about this.
Adam
That's what I epxected :roll: ... It is only a weak excuse. In my opinion the problem is that ccsm, if it was well-designed, should use dbus for communicating with compiz (it would need some small additions to compiz to work also when it is not running, but that's nothing really difficult). The python-plugins get correctly listed through dbus and they behave exactly like the C-based plugins. I am afraid this is another situation where the user has to suffer from the "I know it better"-attitude of several developers.
@maluze: Could be that the server is down for a moment - just try to pull again in a few minutes or later. That happens from time to time.
:)
maluze
July 27th, 2007, 11:14 PM
FYI, this bug was also closed with the remark: "Thats not a problem of ccsm, but how the python plugins work."
http://bugs.opencompositing.org/show_bug.cgi?id=259
I did inquire further about this.
Adam
That's what I epxected :roll: ... It is only a weak excuse. In my opinion the problem is that ccsm, if it was well-designed, should use dbus for communicating with compiz (it would need some small additions to compiz to work also when it is not running, but that's nothing really difficult). The python-plugins get correctly listed through dbus and they behave exactly like the C-based plugins. I am afraid this is another situation where the user has to suffer from the "I know it better"-attitude of several developers.
@maluze: Could be that the server is down for a moment - just try to pull again in a few minutes or later. That happens from time to time.
:)
Ok, this is a bit off topic, but when i tired git-clone the first few times, it must have downloaded some stuff, like creating the directories. So, when I tried to do it again, it says 'destination diretcory 'python' already exists'...how do I remove the directory (which is not empty) so I can try it again? only root can modify it...
RYX
July 27th, 2007, 11:24 PM
If you already "cloned" the main branch, you just need to run "git pull" in the "python"-directory to update your local copy. You should always run "make clean" after you pulled the latest changes (at least for the python-plugin).
maluze
July 28th, 2007, 07:50 PM
Ok, I've tried to download from the git-repositories numerous times, using git-pull, and each time i get this after a while...could it be that the server is down?
justin@justin-desktop:~/python$ sudo git-pull git://people.freedesktop.org/~mike/python
Password:
fatal: unable to connect a socket (Connection timed out)
Cannot get the repository state from git://people.freedesktop.org/~mike/python
RYX
July 28th, 2007, 08:17 PM
Just enter "git pull" ... no url, nothing else ;) ...
maluze
July 28th, 2007, 08:32 PM
^ nope, that doesnt work either; I went to the empty directory it said it created :
justin@justin-desktop:~/python/.git$ sudo git-pull
Password:
fatal: /usr/bin/git-pull cannot be used without a working tree.
and I also tried using git-clone to clone to a different directroy "python2" and I got the same error message that i did in my first post here:
justin@justin-desktop:~$ git-clone git://people.freedesktop.org/~mike/python /home/justin/python2
Initialized empty Git repository in /home/justin/python2/.git/
fatal: unable to connect a socket (Connection timed out)
fetch-pack from 'git://people.freedesktop.org/~mike/python' failed.
RYX
July 28th, 2007, 08:41 PM
Usually you just enter git clone git://people.freedesktop.org/~mike/python if you want to initially download the source tree.
Later, if you want to update, you enter the "python"-directory and run git pull If it can't find the server then it should be just a temporary connection problem.
maluze
July 31st, 2007, 11:09 PM
well the git repo seems to be down... I dont know what else to say...
RYX
July 31st, 2007, 11:36 PM
I updated from it an hour ago, it shouldn't be down. It can be really slow from time to time. Do you get any errors? You should never run git through sudo. And don't run "git pull" inside the ".git"-dir ... (and "git pull" is not needed at all unless you want to update your local tree).
Can you visit the gitweb page for the python-plugin (http://gitweb.freedesktop.org/?p=users/mike/python.git;a=summary)?
maluze
August 1st, 2007, 12:19 AM
^ strangely enough, I can visit that website...but when i run git-clone like i did before, it keeps saying unable to creat a connection (socket refused or something along those lines...)
In regards to git pull, this is what i get when not in "./git"
justin@justin-desktop:~$ cd python
justin@justin-desktop:~/python$ git pull
/usr/bin/git-fetch: 109: cannot create .git/FETCH_HEAD: Permission denied
justin@justin-desktop:~/python$ sudo git pull
Password:
fatal: 'origin': unable to chdir or not a git archive
fatal: The remote end hung up unexpectedly
Cannot get the repository state from origin
justin@justin-desktop:~/python$
...i dunno what else to do =/
RYX
August 1st, 2007, 01:05 AM
First you should remove the whole python-dir with "sudo rm python". Then try to clone again and NOT use sudo for that (there is nothing that needs root-permissions).
maluze
August 1st, 2007, 02:29 AM
^ apparently rmdir (which i think is what you mean) doesnt work when the directory is not empty...
RYX
August 1st, 2007, 11:44 AM
No, I meant "sudo rm -rf python" (-rf means "recursive" and "force") ... I just forgot the options.
:)
maluze
August 2nd, 2007, 05:04 AM
Is there another way to get the python plugins? Suffice to say, I removed the python directory, did git-clone, and it still didnt work... =/...can someone upload it somewhere else?
maluze
August 2nd, 2007, 08:27 PM
In case someone is interested, I have updated Mike's python-based widget plugin to work with the latest version. It is not perfect yet, but at least it doesn't crash. To use it, you need to load the python-pluginloader-plugin after all your other (C-based) plugins. Then you activate "pywidget2" like any other plugin. Now you can use the "widget=1" match-expression in all plugins that support window-matching (e.g. animation, fade, ...) and apply certain effects only to your widget-windows (currently only the screenlets support this ;)).
:)
thanks to mikedees mirror, i was able to install the python-plugin and the plugins. (I also created pywidget2 using what you posted). However, when I open CCSM, I only see "python plugin loader" and "paints a small version of each window which acts like a pager" as new ones. I dont see any of the other plugins that were supposedly installed, including pywidget. Any help here?...and when I go to ./compiz/plugins, I see all of the python plugins there... =/
RYX
August 2nd, 2007, 09:18 PM
Please save this code as "pywidget2.xml" to your "$HOME/.compiz/metadata"-folder and try if the pywidget2-plugin now shows up after restarting compiz/ccsm:<?xml version="1.0" encoding="UTF-8"?>
<compiz>
<plugin name="pywidget2">
<short>Widget2 (python)</short>
<long>Widget2 (python)</long>
<display>
<option type="action" name="widget_toggle">
<short>Hide/Show widgets</short>
<long>Hide/Show widgets</long>
<allowed key="true" button="true" />
<default>
<key>F9</key>
</default>
</option>
<option type="float" name="brightness">
<default>0.3</default>
<min>0.0</min>
<max>1.0</max>
<precision>0.01</precision>
</option>
</display>
</plugin>
</compiz>
maluze
August 2nd, 2007, 10:05 PM
nope, it doesnt show up...
RYX
August 2nd, 2007, 10:20 PM
Did you restart ccsm after enabling the python-plugin?
maluze
August 2nd, 2007, 10:41 PM
Yes. I restarted my computer, switched to metacity and back to compiz. I checked each time, and the python plugins do not appear.
RYX
August 2nd, 2007, 10:54 PM
OK, good to know - even though it's bad that it doesn't work. I am already discussing this with the ccsm-devs and we are trying to work out a solution to make the python-plugins show up in ccsm. I don't have it installed so I can't test it atm ...
:)
maluze
August 3rd, 2007, 04:12 AM
It seems like I misread your previous post about adding the .xml file :oops:
anyways, I created the .xml file, enabled it in CCSM (it didnt work --no surpise there), and becuase I started Compiz using terminal, I noticed this particularly interesting line:
/usr/bin/compiz.real (core) - Error: Couldn't load plugin 'pywidget2'
this was also the same message for 'basiczoom' and 'minime'...
RYX
August 3rd, 2007, 08:08 AM
That explains why it doesn't work :) ... Copy/Paste of python-scripts can be a bit tricky because you may miss indentation. Did it say anything else except that it can't load the plugin? Did you get any python-errors?
maluze
August 3rd, 2007, 01:11 PM
this was all it said:
/usr/bin/compiz.real (core) - Error: Couldn't load plugin 'basiczoom'
/usr/bin/compiz.real (core) - Error: Couldn't load plugin 'pywidget2'
/usr/bin/compiz.real (core) - Error: Couldn't load plugin 'minime'
/usr/bin/compiz.real (python) - Warn: Cube plugin not loaded, compizcube module will not be available
/usr/bin/compiz.real (python) - Warn: Scale plugin not loaded, compizscale module will not be available
orangebase
August 11th, 2007, 07:10 PM
I can't seem to compile Mike's python plugin. Any details I'm missing out on?
maniac
August 12th, 2007, 12:37 PM
The old (C-based) widget-plugin is really outdated and buggy (and one big design flaw). There is a way better python-version of a widget-plugin. You'll need to install mikedee's python-plugin first, then you can use the python-based widget-plugin.
Mike's widget-plugin adds regex-matching for widgets so you can use any other plugin and have its effects applied only to widget-windows (using the common match-interface e.g. "type=Widget") ...
Maybe someone likes to write a C-version of it to have it installed by default with the fusion-plugins (there are already 60 plugins installed, so one more doesn't make it worse, does it?) ;) ...
:)
Rewrite done: http://gitweb.opencompositing.org/?p=users/maniac/widget;a=summary ;)
As the pywidget, it contains a match handler to match widgets (hint: add "widget=1 & override_redirect=0" with an animation of your choice at the top of the open and close animation lists). Additionally, you can match windows to be recognized as widgets (I use "name=Screenlet" there) and the fadeout happens with a nice animation.
This plugin will soon move to http://gitweb.opencompositing.org/?p=fusion/plugins/widget;a=summary as it will be included in the -extra plugins.
maluze
August 18th, 2007, 02:52 PM
Is there any way that you can make it a direct download? my computer can't seem to download git repos, it seems to be a firewall issue :(...
plun
August 18th, 2007, 04:45 PM
Is there any way that you can make it a direct download? my computer can't seem to download git repos, it seems to be a firewall issue :(...
Its much easier if you edit your profile so we see what dist you are running.
Ubuntu, git-core must be installed
sudo apt-get install git-core
Widget:
plun@dunder:~$ git-clone git://anongit.opencompositing.org/fusion/plugins/widget
Initialized empty Git repository in /home/plun/widget/.git/
remote: Generating pack...
remote: Done counting 54 objects.
remote: Deltifying 54 objects.
remote: 100% (54/54) done
Indexing 54 objects...
remote: Total 54 (delta 28), reused 0 (delta 0)
100% (54/54) done
Resolving 28 deltas...
100% (28/28) done
plun@dunder:~$ cd widget
plun@dunder:~/widget$ make
convert : widget.xml.in -> build/widget.xml
bcop'ing : build/widget.xml -> build/widget_options.h
bcop'ing : build/widget.xml -> build/widget_options.c
schema : build/widget.xml -> build/compiz-widget.schema
compiling : widget.c -> build/widget.lo
compiling : build/widget_options.c -> build/widget_options.lo
linking : build/libwidget.la
plun@dunder:~/widget$ sudo make install
install : /home/plun/.compiz/plugins/libwidget.so
install : /home/plun/.compiz/metadata/widget.xml
install : build/compiz-widget.schema
:)
maluze
August 18th, 2007, 09:25 PM
I'm sorry, I havent been posting here much after the forums merged, and as a consequence you might not be familiar with me.
I am running Ubuntu Fiesty, have git-core installed. I have made it known before that due to some odd firewall issues, git-clone does not seem to be working, you can find the posts earlier in the thread.
..and that is why i am not able to use git-clone
plun
August 18th, 2007, 09:54 PM
I'm sorry, I havent been posting here much after the forums merged, and as a consequence you might not be familiar with me.
I am running Ubuntu Fiesty, have git-core installed. I have made it known before that due to some odd firewall issues, git-clone does not seem to be working, you can find the posts earlier in the thread.
..and that is why i am not able to use git-clone
Aha....:) Sorry.
I checked with my firewall, Firestarter and GIT is using port 9418
vBulletin® v3.7.1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.