Creating standard themes
Today I have been doing a little research into how likely a cross-toolkit theme is. After some comments I made in a [previous blog entry](https://archivedblog.jonobacon.com/viewcomments.php?id=586), I had some comments from [Ross Burton](https://www.burtonini.com/) and the discussion led onto that of how Cairo stacks up against [Arthur](https://doc.trolltech.com/4.0/qt4-intro.html); the new Qt painting system. To get a better idea of where Trolltech are heading, I mailed Matthias Ettrich to see what his thoughts were. Matthias is naturally really eager about Arthur, and he felt that Arthur provides a better solution to the problem than Cairo currently offers. The discussion continued about how a cross-toolkit theming API could be developed, but Matthias believes that we should instead pick a few standard themes and create versions of those themes for each toolkit. He is of course, entirely correct.
I am convinced we really need a limited bunch of standard themes that can be implemented in a variety of toolkits. So, for example, lets say we have a theme called *Sizzle*. It would be great to have a detailed specification of how the theme should work, and then the relevant Qt, GTK and other developers can take that specification and implement it in their toolkit of choice. Naturally, the specification and choices made to create that specification need to be created by people who are keen to build this inter-operability with KDE and GNOME and other desktops/window managers. Some themes will naturally look a little more like KDE and some more like GNOME.
The perfect place for this to happen seems to be [The Tango Project](https://tango-project.org/Tango_Desktop_Project). The folks behind this project are creating icon specs and style guides to satisfy some of these goals, but a consistent theme has not been the focus of the project as yet. So, I headed over to `#tango` on IRC and had a chat with [tigert](https://www.tigert.com/) and `straw` and they are keen about the idea. The challenge of course is not only in building a theme specification that everyone is happy with, but also attracting developers to create the theme implementations. Unfortunately it seems that not a huge amount of Qt and KDE people are hooking in with Tango, despite the project’s extensive campaign to assure everyone that it is not a GNOME specific effort.
I think this is an exciting time for the look and feel of desktop Linux, and Tango is really important to help unify these disparate entities. Lets see where the discussion takes us…
Crazy rights
This morning I popped over to see the [LUGRadio Listener Map](https://www.lugradio.org/map) and it looks ever more astonishing:
Last night I wrote an article called [UK Digital Rights: Make Your Pledge](https://www.oreillynet.com/pub/wlg/8591) to encourage people to go and [sign up](https://www.pledgebank.com/rights) to fund the [Open Rights Group](https://www.openrightsgroup.org/). I am pleased to see they have achieved their 1000 pledges, and they continue to roll in. Thanks to everyone who has signed up, and those of you who haven’t, there is still time to pledge. 🙂
Thanks for the [comments about Cairo](https://archivedblog.jonobacon.com/viewcomments.php?id=586), [Ross](https://www.burtonini.com/). Your comment pretty much lines up with what I feared. It seems to make no sense at all that Trolltech are using their own drawing API. I can’t imagine this is for cross-platform reasons as Cairo has been developed for cross platform interoperability. I am going to poke a few Trolls to see if I can find out more about this.
—–
The future is Cairo
This week I am giving a PHP and MySQL course, hence being rather busy teaching my 8 young padawans the finer concepts of web development. We made some good progress today. It is always fascinating doing these courses as they give an essential, grounded insight into the variety of reasons why people want to learn the technology. I also love to see those eyes light up at what they can do…
There has been some interesting development recently with regard to [Cairo](https://cairographics.org/introduction). As many of you will be aware, the idea of Cairo excites me to unnatural proportions. Aside from the obvious graphical improvements that are inherent in a finer grained and better quality rendering system, I am really excited by the way Cairo opens up more possibilities for artists and designers. We really need more of these people on board – we are seriously starved by the lack of quality artists available, with only a few at the last headcount. With all the discussion of how distributions such as [Dapper](https://wiki.ubuntu.com/DapperDrake) should be polished and sheened, a lot this effort needs to go into the visual quality of the interface. We really need teams of dedicated developers who are fluent in Cairo to turn our applications into truly beautiful interfaces.
A good example of this is MythTV. Although I am pant-wettingly excited about my snazzy MythTV box, the interface really could do with some work. The main problem is that the interface is not particularly optimised, and although it looks good, it could look *so* much better and work *so* much better. This will take time as it is written in Qt3, and a Qt4 port is [not on the cards](https://www.gossamer-threads.com/lists/mythtv/users/137959?search_string=qt4;#137959) until Isaac feels like the Qt has stabilised a few point releases down the line. The problem of course is that Qt does not naively support Cairo, and although there are examples, it is going to be more of a pain to use Cairo extensively without native support. This naturally requires some buy-in from Trolltech, and I really do hope they go for it. Can anyone shed any light on this?
Recently though, it seems more and more applications are moving to Cairo, such as GTK, GNOME themes, Diva, OpenOffice.org etc. I don’t think many people deny Cairo the crown as the vector graphics king, and despite some concerns about speed issues, it seems the developers are really ploughing through the bug reports and fixing up performance as best they can. I would be fascinated to see someone like Federico or Behdad go to town on Cairo and see how it can be optimised, but then again, I don’t know if you need to know about low-level maths algorithm hacking to optimise it any further.
I really want to have a crack at doing some Cairo sometime soon. The quality of work that some people are coming out with, such as [Clearlooks](https://www.stellingwerff.com/) is incredible.
The big question is, if Qt supported Cairo as the backend, would this make themes work for both Qt and GTK with minimal modifications?
MythTV works!!
Today I spent a couple of hours before my band practice working on the MythTV box. Today I managed to tweak the grandiose piece of joy into a state where it actually records TV shows. Yes, now the MythTV box works as expected, and my tests with Eastenders and Diagnosis Murder reaped great rewards. In addition to this, I also got the LCD screen on the case fully working, and my remote control is now complete. I felt the kind of joy that sometimes inspired a man to have an intimate moment with himself. 😛
Actually, I must confess, the remote control works, but a cheated a bit. Looking at [venky.ws](https://www.venky.ws), it seems to be a huge pain in the arse to get the directional pad on the remote control working. The other buttons work fine, and they are mapped into MythTV fine, but to make the directional buttons work you need to apply one of a number of patches, none of which seem to work 100% correctly. I am sure Venky will have all this sorted out soon, but until it is stabilised, I cheated by making some lesser used buttons (such as the Windows key) map to the Up, Down, Left and Right buttons. Does the trick, and I am happy with that.
So, what’s left? Well, I still need to get sound in TV working, but I suspect this is an option to select which sound driver somewhere. Sound works fine for everything else, so I guess it should be a doddle. I also need to get TV out working, but there seems to be plenty of documentation out there for this. The only other thing I want to fix is to get MythGame working, but it seems the Breezy packages for this are buggered.
I tell you, although its quite a bit of work to get going, building a MythTV box gives you that kind of satisfaction that I suspect Woz experienced when he presented his latest computer at the Homebrew Computer Club. Sure, its not comparable in terms of geek cred, but I am incredibly excited that I have a home entertainment system that (a) runs on Ubuntu and (b) I can tweak to infinite proportions.
Now, some of you MythTV nutters may be able to help with something. Earlier I had the idea of creating a MythTV module in which you can easily run another (non-MythTV) application. As an example, I would love to run Doom III on the box – but I don’t really want to plug in a keyboard and press Alt-F2 to run the program. I really want to have a nice large icon that I can select with my remote control and then play Doom III with my joystick. Does anyone know if such a thing exists? It seems a fairly simple concept, and it would be so handy to have a bunch of non-MythTV things that I can run as easily as selecting a MythTV component. Oh, and I know at least one of you is going to suggest Freevo as I can hack it in Python – well I have settled on MythTV, so don’t plonk that in the comments box. 😛
In other news, yesterday I mixed some of the LUGRadio Live 2005 recordings. I did the Intro, Rufus Pollack, Mark Shuttleworth and the Mass Debate. We need to consider how we are going to release these as I don’t think we can bang them into the LUGRadio mirror system. I think torrents are the solution here, so I will need to run it past Omahn.
Markdown
Today I confirmed Matthew Bloch and Jonathan Riddell for [LUGRadio Live 2006] (https://www.lugradio.org/live/2006/). In addition to their talks, they will also be exhibiting at the show. Also, my friend yours, Josette from O’Reilly will be there to sell books. Everything is really coming together well.
I have now switched my blog over to use [Markdown Syntax](https://daringfireball.net/projects/markdown/). Switching to this was prompted by some of the limitations that were exposed when I tried to post my [MediaWiki Skinning HOWTO](https://archivedblog.jonobacon.com/viewcomments.php?id=583). The challenge was that the HTML tags inside `
` tags were still acting as tags. This was fine to fix, but I still wanted the tags outside my `` tags to work. After a chat with [Elliot](https://townx.org/), he turned me onto the idea of using Markdown. I chose Markdown over Textile as there is a [great PHP implementation](https://www.michelf.com/projects/php-markdown/). Thanks to Elliot for the suggestion. Speaking of Elliot, check out his neat Flickr search engine called [Flickrlilli](https://flickrlilli.nooq.co.uk/). Elliot is speaking at LUGRadio Live 2006 too.A few other things:
* The latest episode of LUGRadio is going to be on the cover disk on [Linux User & Developer](https://www.linuxuser.co.uk/).
* I have added two confirmed dates for speaking appearences on the [Events](https://archivedblog.jonobacon.com/events/) page. This include SCALE 4X in Los Angeles and WYLUG in Leeds. I am also speaking at ManLUG in the new year, but need to finalise some details first.
* An OpenPOWER machine is on its way from IBM. Should be fun see how it works. They certainly look rather snazzy.
* The backlog of things in my head is beginning to spill out of my ears. The first of a few articles I have been meaning to write is coming soon...
* The Sony VAIO which arrived the other day is running pretty well, and Breezy seems great on it. Still no success in turning the damn Synaptics touchpad off though.
Customising MediaWiki
OK, I have had a few requests from some of you asking if I could knock up some instructions about how to customise MediaWiki to not look like a wiki, but instead resemble a normal site. Instead of giving you a step by step guide about how to do it, I will instead just tell you the changes that I made and the files that you need to know about.
Now, before you begin, bear in mind that wiki pages have a cache. It is likely that you are going to make changes to a page and you will not see the results immediately. You have a couple of options here. Firstly, you can hammer that F5 key into oblivion. The other option is that you add `?action=purge` to the end of an URL. This should purge the cache and you will be, as they say in some parts of London…golden.
## Getting started
Start by going and grabbing one of the [many MediaWiki skins](https://meta.wikimedia.org/wiki/Gallery_of_user_styles) and pick one that looks as close to your final design as possible. I picked [this one](https://meta.wikimedia.org/wiki/Gallery_of_user_styles#FratMan). Now install the skin into your mediawiki skins/ directory and update LocalSettings.php to set `$wgDefaultSkin` to the name of the new skin. In the case of the skin I chose, I replaced the MonoBook skin, so I renamed my old skin and then installed the new one.
## Reskinning
Reskinning is largely a case of commenting out the stuff that you don’t want. Inside the `skins/` directory you will see a main file for your skin (such as `MonoBook.php`). This is where most of the skin layout happens. Identify something that you don’t want on the page, and then load up this file and comment it out. As an example, I didn’t want any of that *Powered By* information on the page. Inside the skin file, look out for the code that resembles that block. In the skin I chose, much of it had comments to indicate where it is. So, the code responsible was:
html(‘poweredbyico’) ?>
data[‘copyrightico’]) { ?>
html(‘copyrightico’) ?>
Just add some comments around it:
data[‘poweredbyico’]) { ?>
html(‘poweredbyico’) ?>
data[‘copyrightico’]) { ?>
html(‘copyrightico’) ?>
–>
Reload and it should work (remember you may need to purge the cache or hammer F5). Now go through the rest of the page and pick out the other sections that you need to hide.
## Changing the design
In the theme I chose, there is a main image on the page. I simply right clicked the image and saved it to my disk, then fired up the GIMP and created a new image, using the same image dimensions (actually I cheated and made it a little bigger). Here is my new image:

You can then upload the image to the same place on the web server to replace it and as such see it in the page.
One thing to bear in mind is where the image and the CSS meet in the design. If you look at the previous image, you can see that the red bar extends out a bit at the right. This bar then hooks up with the top background image:

This image is repeated across the page by the CSS. The main css file, `main.css` can be found in the `skins/monobook` directory and you need to edit:
#titleBar {
background: url(titlebar_bg.png) repeat-x; /* blue and white background */
}
## Restricting logins and adjusting edit links
When I was skinning my MediaWiki installation, I wanted it to only allow edits from a single account – the admin account. The primary function of the wiki was to enable a number of admins to edit the pages without logging into a shell or requiring a huge CMS. The MediaWiki documentation about this was rather confusing as it did not clearly differentiate between the versions prior to and post version 1.5. There are however some key changes.
For versions later than 1.5, you need to add these settings to `LocalSettings.php` after the `require_once( “includes/DefaultSettings.php” );` line:
$wgGroupPermissions[‘*’ ][‘createaccount’] = false;
$wgGroupPermissions[‘*’ ][‘read’] = true;
$wgGroupPermissions[‘*’ ][‘edit’] = false;
Check the documentation about what these settings mean.
When you add a new section to the page, you will typically see the edit links appear. This is rather unsightly, and I wanted to be able to turn this off. There is an [official way](https://meta.wikimedia.org/wiki/MediaWiki_FAQ#How_can_I_disable.2Fenable_tabs_at_top_.28monobook.29.2C_add_history_navigation_to_article_pages.2C_or_otherwise_move_around_functional_components_from_page_to_page.3F) to do this, but it did not work for me, so I just went into a file and commented out the code that displays the link. The problem is that I can’t remember which file, so you will need to look for this yourself. 😛
One thing I certainly wanted to change was to move the edit links from the sidebar to just underneath the main content of the page. The first thing was to head over to `MonoBook.php` and comment out the editing tools block. I then jumped to the `footer`
data[‘content_actions’] as $key => $action) { ?>
“>
Finally, I jumped to the top of the sidebar column (called `column-one`) and added an unordered list that displays some hardcoded links to the main pages on your site.
You can see the results of my work on the [LUGRadio Live 2006](https://www.lugradio.org/live/2006/) website. You also really check the [MediaWiki FAQ](https://meta.wikimedia.org/wiki/MediaWiki_FAQ) as it is quite expansive.
Odd, huh?
Busy as usual
Guess what? The LUGRadio Live 2006 site is now live!! I am quite pleased how it has all hung together, and now things are officially on the way. Remember folks, send us your ideas and how you can help! Incidentally, I am going to document what I did to skin MediaWiki sometime soon, so keep your eyes peeled.
Today a new Sony Vaio TX arrived on my desk. This tiny little computer packs in a 1.2GHz Pentium M, gig of RAM, 11.1″ screen, 60 gig disk, DVD burner, wireless and bluetooth. Its quite a snazzy little box, and I am looking forward to squeezing breezy onto it.
This week has been busy with lots of meetings and lots of things going on. Tomorrow we have a planning meeting to discuss our next season of events, and I am still in the throws of learning all about VoIP. Busy times.
Also, I have a few events booked into my calendar that I will be announcing soon. I will be travelling around the UK doing some talks at some LUGs. Let me know if you would like me to come up to your LUG to ramble incessantly. 🙂
Things and tings
Hefty weekend. Sooz’s sister and her other half came up to stay and it was nice to see them. Its been too long since we have met up and it was nice to hook up after so long. We are not going to leave it that long again.
LUGRadio Season 3 Episode 3 was released today. For some strange reason my wireless access point decided to die an untimely death this weekend, and as such I could not mail the master LUGRadio file to Matt for encoding. So, Matt sent me the encoding settings and I poked and prodded it into submission. Encoding ogg files is not exactly the easiest thing in the world, and the process involves some rather hairy gotchas. Matt seems to have figured much of this nonsense out though. 🙂
The discussion of LUGRadio Live 2006 is flooding in and people are starting to get excited about it. Its quite weird; a few comments I made on IRC have been picked up and blogged about, and we haven’t even officially announced it yet. There are still a few final blemishes to scrub out on the new website, but then it will be released in all its glory. Today I was hugely pleased to find out that Martijn van de Streek is coming over from Holland to talk about Ubuntu. I met Martijn at EuroOSCON and he is great fun. Those of you who loiter in the LUGRadio IRC channel will know him as Treenaks.
It was also good to hear from Graham at OpenForum Europe today. They are doing some good work over there. It will be interesting to see their efforts pan out and how they will affect the take-up of Open Source.
Oh, and thanks for the nice comments some of you have mailed me about the new site. It seems to be settling in well now. Good to know it is an improvement over the previous incarnation.
—–
MediaWiki hacking and LRL
Today I have been fiddling with MediaWiki. For quite some time I have wanted to learn how to customise it for use as a normal site. It seems that MediaWiki is pretty ideal for those people who just want to put up a simple site in which a number of people can edit the content. Sure, it stops becoming a wiki, but the fact that a closed group of people can collaborate on it is pretty cool.
To do this, I downloaded an existing theme and basically hacked it into oblivion. Most of the general configuration for MediaWiki is done in LocalSettings.php and then you need to hack the general theme file in skins/ and edit the stylesheet in the theme’s folder. Unfortunately, the current state of MediaWiki requires some hackery to get all this working. You need to comment out the sidebar blocks, upload your own logos, ponce around with the CSS and more.
I plan on revealing the results of my efforts sometime over the next week or so.
Oh, and before I forget, LUGRADIO LIVE 2006 IS CONFIRMED!!!! It takes place at the Wolverhampton Students’ Union in Wolverhampton on the weekend of the 22nd and 23rd July 2006. A two day extravaganza and a party on the Saturday night. More details to follow…
—–

