My first plugin

Bruno Jesus 00cpxxx at gmail.com
Tue Aug 15 04:36:01 CEST 2006


On 8/14/06, James Westby <jw+xfce at jameswestby.net> wrote:
> On (14/08/06 02:13), Bruno Jesus wrote:
> > Yesterday I've spent some hours trying to make a plugin work, i've
> > learned some gtk/gdk but as I know nothing about makefiles I've built
> > it under the clock plugin (it uses the clock_constructor because if I
> > change it's name, it will not compile anymore, I really don't know
> > why). It's a simple network state plugin, it reads /proc/net/dev,
> > looks for eth0 and shows in 5 images it's state (unredable,no
> > transmission,tx,rx,txrx).
> >
> > Can anyone help me doing a makefile for it? I've attached a .tar.gz
> > with everything necessary to make it run (I hope). I'm almost sure it
> > only runs on linux boxes because of how I read data from /proc. I also
> > know I've used bad programming techniques (like hard-linking the
> > images) but as I said, it's my first plugin =)
> >
>
> http://jameswestby.net/scratch/xfce4-netstate-plugin.tar.gz
>
> is something that you can work with.
>
> I took the liberty of moving things around and changing the code to make
> it fit in with the panel plugin scheme better. There is still plenty to
> do though.
>
> If you untar, and the run xdt-autogen in the directory you will have the
> stuff ready for a ./configure etc.. run.
>
> Currently the code to actually do the detection is commented out, as I
> couldn't compile with it in.

Thank you a lot, i've spent about 3 hours trying to understand the xdt
tutorial from http://foo-projects.org/~benny/projects/xfce4-dev-tools/index.html
but there, it's explained only how to do a program with the tools, not
a panel module.
Then I tried copying showdesktop plugin configure.am and Makefile.am
but it was unsuccesful. Thank  you again =)

> I suggest that you look in to using ioctls to get the information that
> you want, it will be a cleaner interface. However you can just stick to
> the parsing if you want.

I think I'll try to copy the detecting stuff from netload plugin, it's
a lot better than mine and support more OSes. This was just a plugin
idea, it was the first thing I thought about because I miss too much
something blinking in the panel.

Thanks for reorganizing the code! I'll try to make it better now.

> Please reply to the list if you have any more questions.
>
> James
>
>
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev at xfce.org
> http://foo-projects.org/mailman/listinfo/xfce4-dev
>


-- 
Bruno Gonçalves de Jesus
Live free() or die()!


More information about the Xfce4-dev mailing list