Saturday, July 2, 2011

Interactive Fiction and PiFi

About 3 years ago I started a small pet project named PiFi (Python Interactive Fiction Interpreter). You can read about interactive fiction here (they are often called text adventures). The interpreter is actually a virtual machine (much like the one java uses) so as to be able to run the same zcode story files on any platform. This isn't something new: that was the way the first zcode interpreter from Infocom used to work in the early '90s. However, it might be the first python zcode interpreter to reach this state of functionality! :-)

The only reason I started this project back then was to help me learn to code in python. I didn't expect it would be able to run anything at all at that time, and for about a year I had stuck to a stupid bug that wouldn't allow most of the stories to even start. However, I am now really glad to announce that it can finally run a lot of interactive fiction stories from start to finish without any problems. It's only dependency is PyQt4. There is of course a couple of minor bugs and it is still considered in alpha state (some opcodes are missing) but you can give it a try with any version of infocom (zcode) story files except version 6. There is a big archive of free to use story files in You can find the link to the git repository for PiFi on the right side of the blog.

Monday, May 30, 2011

libEasyRandR and kdisplay update

libEasyRandR is still progressing quite well and can already catch some unwanted arguments for the RandR extension functions. kdisplay is the GUI app that helps in testing this lib and is able to list all available outputs from all virtual screens on your computer, change their resolution and place them using absolute position in virtual screen space.

Testing the RandR extension is no fun if you are not careful enough. I have caused my display to go blank with no way to restore it except killing the Xserver! :-( I don't know if it was caused by bad graphics driver or some condition that wasn't covered in RandR.

Luckily, in the later versions of VirtualBox you are able to add multiple monitors to your virtual machine thus enabling me to test kdisplay without risking killing my Xserver all the time. Also I can do tests with more than 2 outputs without having to get my desk cramped with monitors :-) Here is a screenshot of my virtual setup:

And to think that all these are run in a quite old laptop!

Monday, March 14, 2011


I've been trying to create a library to simplify the use of randr functions in X server. It's still a long way from being complete however I have already implemented most of the functionality that exists in v1.3 of the randr specification. I have written a small test program to test if the library actually works and for now I'm able to query the xserver for the available outputs, what modes they support, which one is being used now and much more. I have added support for also making changes to the configuration but it hasn't been tested for now. For anyone interested in the project, I'm using github for the project. You can find it here.

The next step is to create a nice GUI application to use the lib. I'll be making some tests with some concepts I have for multimonitor configuration and I'll be posting the progress. You can find the GUI app in the github repository as well (kdisplay) however it doesn't do anything for now.

Sunday, May 23, 2010

mplayerthumbs eating all your memory?

There is a nice feature in kde which helps identify a file by its contents. This file previewer uses the mplayerthumb  package for previewing movie files however, which if used with the phonon backend it could end up eating all your systems memory, briging your computer to a halt :-/

If you seem to have a problem with a process named kio_thumbnails eating all your memory even though you have specificaly asked that files bigger than xMB (where x is lower than the system memory) shouldn't have a preview, then you should have a look at mplayerthumbsconfig. It is a small gui program that comes along with mplayerthumbs and helps you config a couple of things.

The option that you should change for now is the one labeled backend. Select mplayer and you are done. This problem should (and probably will) be corrected in the next version of kde. It affects kde4 versions till kde 4.4.3 for sure. :-/

Sunday, January 17, 2010

Sabayon: Configuring KDE to use wicd

The first problem I encountered in Sabayon Linux was that solid was compiled only with NetworkManager support and not wicd. The actual problem is that I find NetworkManager still not ready for everyday use. I had quite some problems with it in the past and even now that almost everything seem to work, there are some glitches in the applet that make it quite irritating to use. So what can be done? Can you use wicd instead of NetworkManager? Yes, but it cannot be configured from the KDE system settings.

The first thing you have to do is to login as root and stop the NetworkManager service with:
/etc/init.d/NetworkManager stop
rc-update del NetworkManager
Next you have to start the wicd service:
/etc/init.d/wicd start
rc-update add wicd
Now almost all should be set. You can launch wicd using either Alt+F2 or from a terminal to test that it works. You should be able to run wicd as a normal user too. However wicd will not appear in the system tray the next time you log in to KDE. You should create a file named wicd-tray.desktop in ~/.config/autostart/ with the following content:

[Desktop Entry]
GenericName=Network Manager
Name=Wicd Network Manager Tray
Name[en_US]=Wicd Network Manager Tray
Comment=Display network connection status in the system tray
Comment[en_US]=Display network connection status in the system tray
And that's about it! Have fun! :-)

Sabayon Linux 5.1

Even though I'm a Gentoo user for quite some years on my desktop pc, I recently got a laptop that isn't quite so powerful to be used for compiling big packages. It will take hours (even days) to get a working system with kde running. So I decided to try some distributions with binary packages which can be installed quite fast and have a system ready to use in less than an hour.

At first I tried Kubuntu as it is so popular and I must say that I was quite satisfied with the way it worked. It detected all devices without having to deal with configuration files and everything seemed fine until I tried to change some of the default settings. Where are all my configuration files? Unfortunately there are some differences between distributions so I had a hard time finding out where to do what and also I had to deal with both Gentoo and Kubuntu bugs...

So I thought: "It would be cool to have the power of Gentoo and the convenience of using binary packages...". And you know what? There is such distribution! And it's called Sabayon Linux. The installation was a breeze with the GUI installer and I must say that I am really impressed with the way everything work so far. It's actually a Gentoo system with prebuild binaries and a new package manager that can be used in parallel with portage!