XFCE4 Hardware Monitor Applet - Port of GNOME 2 Hardware Monitor Applet

Maximilien Noal noal.maximilien at gmail.com
Wed Nov 20 15:07:25 CET 2013

On 15/11/2013 18:26, Omega Weapon wrote :
> Sending this as some may be interested:
> I have managed to port the GNOME 2 Hardware Monitor applet to my XFCE4 
> environment, in order to get at a proper network bandwidth graph for 
> the panel. I've posted the details here:
> https://igurublog.wordpress.com/2013/11/15/gnome-2-hardware-monitor-applet-ported-to-xfce4/ 
> tl;dr:
> Repo with port branch: 
> https://github.com/OmegaPhil/hardware-monitor-applet/tree/xfce4-applet
> Debs: https://github.com/OmegaPhil/hardware-monitor-applet/tree/pkg

Here is an Archlinux AUR package for it :

It works, but the PKGBUILD script has some shortcomings (I'm posting 
this in case there are other Arch users here) :
- it depends on lm_sensors to be built, because the "optdepends" field 
is usually for optionnal dependancies at *runtime*. I might use the 
optdepends array instead, where I would tell the user something like : 
"you must rebuild the package if you want to use this feature".

- having a git uri in the source field makes makepkg (Archlinux's 
utility for making packages) launch git, which clones the depot. Fine, 
but then one only have the master branch, not the xfce4-applet branch. 
So this happens when one tries to build the package :
> ==> Launching build()...
> which: no gnome-autogen.sh in 
> (./:/home/max/bin:/opt/ruby1.9/bin:/opt/ruby1.9/lib/ruby/gems/1.9.1:/root/.gem/ruby/2.0.0/bin:/home/max/.gem/ruby/2.0.0/bin:/usr/bin)
> You need to install gnome-common from the GNOME CVS
> ==> ERROR : An error occured in build().
>     Exiting...

So I'm cloning the branch in the pkgver() function. Two git clone 
commands in a row were one would be enough is far from ideal. But hey, 
that's a problem between me and makepkg.
I tried to call makepkg with the _gitname[1] variable without success.

- For some reason the pkgver function does not work. This is strange, 
because the very same function works in other packages I'm maintaining 
on the AUR, and it was copied verbatim from the ArchWiki anyway. The 
error is :

> sed: -e expression n°1, character 123: command `s' unfinished

- And finally some nitpicking : I was using at some point the prepare() 
function to clone the repo, but since the pkgver() function is launched 
first, and I need to have the xfce4-applet branch in order to have the 
pkgver, I moved the call to git clone -b there. Ideally, the prepare() 
function should be launched first. It smells to have a pkgver function 
that doubles as a prepare() function, doesn't it ?

Apart from that, I got a warning in the build log :
> libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. 
> -DHARDWARE_MONITOR_GLADEDIR=\"/usr/share/hardware-monitor/glade/\" 
> -DPACKAGE_LOCALE_DIR=\"/usr/share/locale\" -pthread 
> -I/usr/include/xfce4/libxfce4panel-1.0 -I/usr/include/gtk-2.0 
> -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 
> -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 
> -I/usr/include/libdrm -I/usr/include/libpng16 
> -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 
> -I/usr/include/pango-1.0 -I/usr/include/harfbuzz 
> -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/xfce4 
> -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -pthread 
> -I/usr/include/xfce4/libxfce4ui-1 -I/usr/include/gtk-2.0 
> -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 
> -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 
> -I/usr/include/libdrm -I/usr/include/libpng16 
> -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 
> -I/usr/include/pango-1.0 -I/usr/include/harfbuzz 
> -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/xfce4 
> -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include 
> -D_FORTIFY_SOURCE=2 -pthread -I/usr/include/libgnomecanvasmm-2.6 
> -I/usr/lib/libgnomecanvasmm-2.6/include 
> -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gail-1.0 
> -I/usr/include/libart-2.0 -I/usr/include/libglademm-2.4 
> -I/usr/lib/libglademm-2.4/include -I/usr/include/gtkmm-2.4 
> -I/usr/lib/gtkmm-2.4/include -I/usr/include/atkmm-1.6 
> -I/usr/include/gtk-unix-print-2.0 -I/usr/include/gtk-2.0 
> -I/usr/include/gdkmm-2.4 -I/usr/lib/gdkmm-2.4/include 
> -I/usr/include/giomm-2.4 -I/usr/lib/giomm-2.4/include 
> -I/usr/include/pangomm-1.4 -I/usr/lib/pangomm-1.4/include 
> -I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include 
> -I/usr/include/cairomm-1.0 -I/usr/lib/cairomm-1.0/include 
> -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include 
> -I/usr/include/libglade-2.0 -I/usr/include/gtk-2.0 
> -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 
> -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 
> -I/usr/include/libdrm -I/usr/include/libpng16 
> -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 
> -I/usr/include/pango-1.0 -I/usr/include/harfbuzz 
> -I/usr/include/pango-1.0 -I/usr/include/freetype2 
> -I/usr/include/libxml2 -I/usr/include/libgtop-2.0 
> -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -O3 
> -march=native -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 
> -MT libhardware_monitor_la-bar-view.lo -MD -MP -MF 
> .deps/libhardware_monitor_la-bar-view.Tpo -c bar-view.cpp  -fPIC -DPIC 
> -o .libs/libhardware_monitor_la-bar-view.o
> applet.cpp: In function 'void applet_construct(XfcePanelPlugin*)':
> applet.cpp:56:10: warning: ignoring return value of 'int nice(int)', 
> declared with attribute warn_unused_result [-Wunused-result]
>    nice(5);  // Don't eat up too much CPU
>           ^
> mv -f .deps/libhardware_monitor_la-bar-view.Tpo 
> .deps/libhardware_monitor_la-bar-view.Plo
Finally, are there release tarballs for this project, or commits tagged 
with release versions in the repository ?

At first, I was going to do a xfce4-hardware-applet PKGBUILD, not a 
xfce4-hardware-applet-git PKGBUILD with a pkgver() function, because 
it's a little more complicated as you may have seen (only a little bit).

However, the plugin works fine and it looks nice. :)

[1] https://www.archlinux.org/pacman/PKGBUILD.5.html#_development_directives

More information about the Xfce4-dev mailing list