Styling problems: living with both Gtk2 and Gtk3

A couple of weeks ago, the harddisk in my small frontend, the one I’ve been using since last January after Yamato started acting up too much to be usable as a desktop as well, decided to give up. It wasn’t much of a bother as I was planning to replace it anyway: the small frontend was supposed to become an HTPC in short time, but for the moment it’s not of importance either since, as I noted previously I recently got a Sky subscription so that I can have most of the content I care about in my bedroom without having to spend time “finding” it.

On a slightly off topic note: I don’t really care for people who tell me I’m not smart to pay for content I could download for free… I’m not proud when I download content I care about from torrents and the like, and since I have more money than time (even though I don’t have much money) I’m pretty much okay with paying for a content subscription … in general, what I end up downloading, it’s stuff I can’t get, even paying, in Italy, such as Bill Maher’s show.

So anyway, when the disk died, which happened to be around the same time the monitor started showing a bad spot in the top-centre area, and a huge one, I decided to finish configuring the box I had lingering around, scheduled to become my new desktop. This was a box I bought for a customer, to be used as a local Asterisk server… the customer at the end had a too-unstable connection and the Asterisk server is now a virtual server in the same data center as the VoIP trunk. I originally wanted to get it running Gentoo Hardened as a desktop, but trouble was ahead: while I was okay with giving up Skype, due to SpiderMonkey, half of Gnome3 wouldn’t start on a PaX-enforcing kernel, and due to Mesa for Radeon, the rest wouldn’t either.

At the end, I disliked the Gnome 3 interface, mostly because it was asking me too much movement with the mouse to do the most obvious things, and while it might appear cool at once, the auto-expanding desktop feature made it much more complex to navigate multiple desktops than I wanted it to be — I hated a similar change in the latest OS X Lion as well, so I wanted to keep my Spaces-alike system with compiz on Linux at least. All this considered, I decided to switch to XFCE4, which seems like a decent replacement: an “usual” desktop system, a bit more minimal in some ways, that provides me with what I need, nothing more nothing less.

Unfortunately, more trouble was ahead: I started with a mixed Xfce4/Gnome3 system, then decided to downgrade most of the Gtk3 apps because they didn’t behave as I wanted them to, but the downgrade didn’t help much — I still can’t get Super-C and Super-V bound as copy and paste in Gnome-Terminal! But Evolution, both before and after downgrade, didn’t let me change the signature set on my accounts, for whatever reason. Since today I was feeling particularly frustrated by this, I decided to check the issue further and went to fix the problem once and for all… and the only solution seemed to be upgrading Evolution to latest 3.x series, argh.

It’s not like I didn’t want to upgrade Evolution per-se, the problem was having a Gtk3 application installed. And the reason for that is actually quite easy to explain: within Xfce4 you can only choose a theme, which is used by both Gtk2 and Gtk3, so one or the other ended up looking very nasty, as it would fall back to the default appearance. This wouldn’t be too bad, considering that Gtk2’s default seemed to be decent enough, but the problem is that the Adwaita theme that comes with Gnome3 is not to my liking: the gradient reminds me of Oxygen, and exactly like that, unless you h ave the whole decoration handled by the same theme, it looks silly.

After trying to build nodoka (which does not build against Gtk-3.0) I was pretty depressed until I found x11-themes/zukitwo, which takes the clever approach. Since there is little chance for a single engine to work on both Gtk2 and Gtk3, it takes two different engines (murrine and unico, respectively) and then applies themes over those to make them look as much as possible the same. Unfortunately for some reason Chromium doesn’t seem to apply the style fully, at least it doesn’t seem to change the scroll bar, that looks still the same as the original Gtk ones.

There’s only a caveat with this theme: for some reason the Xfce4 panel is set to have white text on light grey background; the solution to this is trivial though: edit /usr/share/themes/Zukitwo/gtk-2.0/widgets/panel.rc, looking for the XFCE-related entries, and change the definition style "theme-panel" into style "theme-panel-light" so that it goes back to black-on-light-gray.

And at least one problem is solved!

Fixed in overlay (read: not fixed)

One unfortunately still too common practice I find in my fellow developers is to rely too much on overlays to get users involved; my personal preference on this matter is getting people to proxy-maintain packages, and the reason is that this way I can make sure the fixes propagate to all the other users in a timely matter, as well as being able to intercept mistakes before I commit them to the tree.

But there are other reasons why I dislike overlays; for instance, they often clash enough with each other, or mix should-be-working packages with don’t-even-try … which is the case of the current Gnome overlay. I used to use the Gnome overlay so I could test and help reporting bugs before the next release hit ~arch; unfortunately since a while ago now, the overlay contains Gnome3/Gtk+3 packages that really shouldn’t be mixed in on a system that is actually used.

This became obnoxious to me the moment I went to actually try Rygel (so that I could actually get rid of MediaTomb, if it worked and I could add it to the tree — that code is noxious!). The problem is not in the high reliance of Rygel on Vala, that would be good enough, given that we have it in tree; the problem is that the Rygel UI (and after trying it out I can safely say that you don’t want to try without the UI) requires either Gtk+3 (no way!) or Gtk+ 2.21… which is the “devel” branch and is present only on the gnome overlay. Not even masked in tree.

It wouldn’t have been too bad, if it wasn’t that upstream (finally!) split gdk-pixbuf from gtk+ itself, so you should finally be able to use librsvg without X11 on the system (which is why my charts are available only as SVG and cannot be seen by some browsers who have trouble displaying embedded SVG). Unfortunately, this also means that they changed the path gdk-pixbuf uses to load the loaders (no pun intended); and the current ~arch librsvg won’t pick that up. Again, the librsvg in the overlay has automagic-deps trouble, and require both Gtk+2 and Gtk+3 to be present to work. D’oh!

This is nothing new, what is the problem? Well, ostensibly beside the fact that Arun blogs about something we can’t have ;) — not your fault, I know, not picking on you, don’t worry Arun!

The problem comes when I’ve asked before why the Gnome stuff is not pushed in main tree under p.mask, like most other teams work, especially given that I can make use of the tinderbox to check reverse dependencies before it’s unleashed, rather than have to report them afterwards. Indeed, Gtk+ and other libraries’ updates tend to be quite boring because there is way too much software that define GTK_NO_DEPRECATED and similar, which should only be used during development, and thus fail when stuff they us do get deprecated. Of course even if they didn’t define that, the code would be failing at the following update when they get removed, but that’s beside the point now.

Interestingly enough, though, the effect of (at least some) more recent deprecation seem to be causing the same kind of issue (if, by the mere fact we’re talking about Gtk+, to a lesser severity) of the recent glibc-2.12 release in the form of undefined symbols where GTK_* macros are used.

As you might suspect the tinderbox already stumbled across a few of these packages; while the quick-fix is generally quick (drop the NO_DEPRECATED definition), the complete fix (use the correct non-deprecated API) takes a while, and I can’t blame the maintainers for waiting to hear from upstream on that matter, especially given the way gtk+ is always dropped like a bombshell. Just to be on the safe side, I’ve now added some further tests to ensure that neither the “symbols” requirements caused by gtk+–2.20 nor those caused by glibc-2.12 will be left standing without further notice. If the tinderbox will ever build such a broken package, it’ll be reporting it to me so that I can file the proper bug.

Now, the gtk+–2.21 situation seem to start just as well; gtkhtml fails to build and it’s even part of Gnome itself. I will be begging the Gnome team again, starting from here, for them to add the ebuilds as soon as they are usable in main tree, under p.mask, so that the tinderbox can start churning at them.

But since people seem to think I write too much negatively, I have to say that at least a few developers seem to actually keep in mind there is the tinderbox available; Samuli, Alexis and Jeroen asked for feedback before unmasking (XFCE, Ocaml and libevent-2 respectively), and the problems found have been taken care of much more quickly then even I expected, for the most part. So if you’re a package maintainer and want the reverse dependencies of your package tested before unmasking a version into ~arch, just drop me a mail and I’ll set up a special run. It can take anything between half a day to a week or two depending on the size of the revdep tree and the queued up runs (right now it’s completing a full-system-set rebuild to see if there were more issues with glibc-2.12; turns out I only hit another problem and that was related to GNU make 3.82 instead (another “good” scary bump).

After this post, you can guess the following run is going to target gtk+–2.20. If there are no further runs, after that it’ll resume the daily-build of the tree.

Please keep in mind though: package.mask-ed packages are fine, but the tinderbox will not test any overlay. Get your fixes in the tree proper!

No more breaks

Since this week I’ve been doing lots and lots of work on lscube, of which I wanted to blog but I’m afraid I won’t have much time to do that right now, I wanted to take a break this weekend, to relax, rest, and play a bit. Nothing went like I wanted, and I actually think I won’t try to take again a break like this anytime soon.

Yesterday almost went like I wanted, I worked a bit on my ruby-bombe project, removed the pending notice on some specs actually implemented some functions on it, although it’s still unable to read. I set up the SysRescueUSB key but then i had to finish a support request on a Vista laptop. Could be worse, but Vista by itself is a problem for me: I cannot connect Vista laptops to my router directly, they kill it! I have to connect them through one of my laptops (my mother’s or mine) or through Yamato. I have no idea why. Okay no problem. I finished the cleanup, and the laptop was ready to go.

Today, I was woken up very early since I was to be at home by myself, which also called for a good morning of relaxing playing with the PlayStation… yeah sure. First my brother in law dropped by with my nephew to pick up some of his tools that were left here, then I finally cleared out some tasks for a job I have to do, which called for testing, after lunch.

But while I finish set up the stuff for this job I also decide to set up another side job I was commissioned, of which I’ll try to blog in another moment since it’s really interesting to me and I might actually release it as Free Software afterward. For this job, though, I need Windows, since it’ll have to run on Vista. I have an XP license (not OEM, thus not tied to a box) but it was set up to work on the laptop, since that was the most powerful box I had at the time, and Enterprise was not VT-X capable so I wouldn’t run it there virtually; now the laptop is no longer the most powerful machine at home, and I don’t care much about playing on XP, (I only have two games running there and they should work fine on Wine nowadays), so I wanted to move it out, reclaim the free space on the laptop, and install it on VirtualBox. Unfortunately as soon as VirtualBox starts, Xorg crashes, and it does not wake up the video card when it starts back.

Two hours of fiddlings later I get to find out:

  • gnome-settings-daemon, updated today, does not always start properly; no clue why yet;
  • SDL applications were killing my Xorg, I noticed this with tuxtype before, and the same happened with VirtualBox;
  • the reason why Xorg couldn’t wake up the videocard was the framebuffer; since I don’t even use the framebuffer when SSH is not working (I love serial consoles) but rather the laptop so I can have cut and paste, I just disabled it and I live happier now;
  • the Xorg crash was in the VidMode calls;
  • the Xorg crash was already reported as FreeDesktop bug #17431;
  • the Xorg crash was caused by SDL bundling its own X11 libraries !

So once again not following to the letter the policy that tells us to always use system libraries wasted more of my time than it should have. I guess this is life for you.

On the other hand, I need Mono for the commissioned work I talked above, but Mono in Portage is currently very badly present, since compnerd hasn’t bumped anything in quite some time. Today I opened a few bugs around for Gtk# for instance, and I hope I’ll be able to bump a few things in my overlay and force-feed them to Portage in a week or two.

On a different note, I start to have some hardware cravings, in particular I currently have no free USB port, no Ethernet cable and just one USB to serial adapter left, this is very suboptimal. I guess as soon as my job pays me I’ll be getting a self-powered USB hub so that at least I can replicate a few extra ports. I have a crimping tool for Ethernet cables but it does not do Cat5E cable, and I wanted to buy Cat5e if I was to buy more new cables…

Monitoring a single server

If you follow my delicious you might have noticed some recently tagged content about Ruby and Gtk+. As you might guess, I’m going to resume working with Ruby and in particular I’m going to write a graphical application using Ruby-Gtk2.

The problem I’mt rying to solve is related to the downtime I had; the problem is that I cannot stay logged in in SSH with top open at any time of the day in my vserver to make sure everything is alright, and thus I ended up having some trouble because a script possibly went haywire (I’m not sure whether it went haywire before or after the move of the vserver to new hardware).

Since using Nagios is a bit of an overkill, considering I have to monitor a single box and I don’t want to keep looking at something (included my email), I’ve decided that the solution is writing a desktop application that will monitor the status of the box and notify me right away that something is not going as it should. Now of course this is a very nice target but a difficult one to achieve, to start with “how the heck do you get the data out of the box?”.

Luckily, for my High School final exam I presented a software that already was a stake to the solution, ATMOSphere (yes I know the site is lame and the project is well dead), which was a software to monitor and configure my router, a D-Link DSL-500 (Generation I) that used as operating system ATMOS (by GlobespanVirata I still have the printed in-depth manuals for the complex CLI interface it had, both serial and telnet protocol based); together with the CLI protocol for setting up basic parameters, I used the SNMP to read most parameters out of it. This is the reason why you might find my name related to a library called libksnmp; that library was a KDE-like interface to the net-snmp library (which was at least at the time a mess to develop with), which I used not only for ATMOSphere, but also for KNetStat to access remote interfaces (like the one of my router); since then I haven’t worked with SNMP at all, albeit I’m sure my current router also supports it.

Despite being called (Anything but — ) Simple Network Management Protocol I’d expect SNMP to be much more often used for querying rather than actually manage, especially considering the bad excuse of an authentication system that was included in the first two versions (not like the one included in version 3 is much better). Also it’s almost certainly a misnomer since the OID approach is probably one of the worst one I’ve seen in my life for a protocol. But beside this, the software is very well present (net-snmp) and nowadays there is a decent client library too, in Ruby, which makes it possible to write monitoring software relatively quickly.

My idea was to just write up something that sits in my desktop tray, querying on a given interval the server for its status, the nice thing here would be being able notify me as soon as there’s a problem, by both putting a big red icon in my tray and by showing up a message through libnotify to tell me what the problem is. This would allow me to know immediately if something went haywire. The problem is: how do you define “there’s a problem”? This is the part I’m trying to solve right now.

While SNMP specifications allows to set errors, so you could just tell snmpd when to report there’s an error, so that it was not the agent but the server to know when to report problems, which is very nice since you just need to configure it on the server and even if you change workstation you’ll have the same parameters; unfortunately this has limited scope: on most routers or SoHo network equipment you won’t find much configuration for SNMP, the D-Link ones, albeit supporting SNMP quite well, didn’t advertise it on the manual nor had configuration options on the wepages, the 3Com I have now has some configuration for SNMP traps and has support for writing through SNMP (luckily, disabled by default); I guess I’ll have to add support for writing at least some parameters so I could set up devices like these (that supports writing to SNMP to set up the alarms). But for those who also lack writing support, I suppose the only way would be to add some support for client-side rules that tells the agent when to issue a warning. I guess that might be a further extension.

Right now I’m a bit at a stop because the version of Ruby-Gtk2 in portage does not support GtkBuilder, which makes writing the interface quite a bit of an issue, but once the new version will be in, I’ll certainly be working on something to apply there. In the mean time, I’m open to suggestions as to other monitoring applications that might save me from writing my own, or in ideas on how I could approach the problems that will present themselves. I think at least I’ll be adding some drop-down widget like the one for the worldclock in Gnome (where the timezones are shown) with graphs of the interface in/out bandwidth use (which would be nice so I could resume monitoring my router too).

Okay for now I suppose I’ll stop here, I’ll wait for the dependencies I’ll need to be in Portage, so maybe someone will find me something better to do and a software that does what I look for.