cairo-msg – a simple splash message app

I have been busy coding a splash app in C for Linux (or other UNIX like OS) that is designed to be simple, light weight yet “pretty”. It uses the Xlib and Cairo libraries and stripped, the binary is only 11k.

There really aren’t many light-weight options for a general purpose splash message app, for what I want anyway. Sure there is zenity, yad, Xdialog, gtkdialog (all dependent on gtk), xmessage, yaf-splash (Xlib) and others like Kdialog (KDE) and probably a bunch more but all of those are either too complex or don’t do what I want without some convoluted scripting techniques which slow things down and introduce margin for error. I wanted something simple that only needs to display a few words with a coloured background indicating what kind of message we are displaying, preferably with an appropriate icon . It had to display in a prominent position on screen (adjustable of course) and with no window decoration. It had to support all fonts so had to be unicode compliant. It had to have a variable timeout, without resorting to hacks like this:

splash-message "bla bla bla" &
pid=$!
sleep 5
kill -9 $pid

So, like all hackers, if you can’t find the tool, make the tool! cairo-msg was born!

Check it out on my GitHub page.

NB: This is tested in Slackware64-14.1 (KDE), Slackware-14.1 (Cinnamon) and Slacko Puppy Linux (64 and 32 running JWM).

Advertisements

Slackware 14.1


<!–https://apis.google.com/js/plusone.js–>

(G+)

(twitter)

There you go folks. There is a new slackware out there for your linux enjoyment.

For more info visit slackware.com .

f2fs – booting linux on an f2fs flash drive

Today I had an eureka moment. I installed a full install of Slacko Puppy Linux to an f2fs formatted flash stick, booted and surfed the net. Has anyone done that yet?

The kernel is k3.4.52 patched with f2fs patches from Now Computing. I had to hack them a bit because the developer is only supporting k’s 3.0, 3.2, 3.5 and 3.8. I also patched the kernel for AUFS as we do in Puppy.

The unique problem here is that no bootloader supports f2fs at the time of writing. The work around is to first create a small boot partition in a recognised format such as vFAT, ext2, 3 or 4. Then you can boot the stick with grub (I used grub4dos). You could probably use syslinux, grub2 or even lilo.

In the boot partition you create a /boot directory that contains the kernel image (vmlinuz) and an initrd (in my case initrd,gz). Now in my kernel configuration I have all the relevant drivers that I need as builtins however using an initrd it would work just the same to have hid, usbhid, ehci-hcd, uhci-hcd and f2fs as modules and just load them. In fact, in my init script I have those loading anyway with the error sent to /dev/null. Of course you need a tree with the appropriate modules in the appropriate places, busybox, the necessary mount points and so on.

The real trick was to find the root partition which was on /dev/sdb2, however that would not work, nor would sda2, which probably should have since I wasn’t loading any other filesystems and the only builtin is ext2 (I was using FAT32 on my boot partition). My hard drive is formatted NTFS and ext4. I achieved this by using the UUID in the init script itself. You could just as easy have a config file that init reads.  Once the root filesystem is mounted you then switch root in to the running systems as with any other initrd.

Thanks have to go out to Barry Kauler for integrating f2fs into Puppy Linux infrastructure and for some of the code from his init script. My init script uses some of that but uses a directory structure based on Slackware’s initrd and some of the code from Pat Volkerding’s init script too.

I’ll post the code and documentation at a later date.

Any questions, ask in the comments.

Volcont – simple alsa volume control

This is a small Gtk Status Icon I wrote in C to adjust the volume on Linux based OS with the alsa sound driver.

It is designed to be as light as possible so don’t expect too much in the way of features. I wrote it for the Raspberry Pi computer, which as a desktop is a bit slow however is usable so long as you run a feather weight desktop. I use JWM .

The code is just 70 lines of C and only depends on Gtk and alsamixer. There is no configure script, just build it with the compile script included in the source and install it wherever you want. I put it in /usr/local/bin and run it at the startup of X with the JWM StartCommand tag in my ~/.jwmrc file.The XPM icon is compiled in. You could if you want replace it with something a bit fancier but it must be a valid XPM. By default it’s hard coded to be linked to gtk+-2.0 but there is no reason you couldn’t link it to gtk+-3.0. I have done this before with status icons I have written.

There is one special option to the compile script. If you run Raspbian on your Pi then pass the “raspbian” option to the script like so (I think Arch for Pi is hard float too, so you could try it there):

./compile raspbian

This adds some special options to gcc to compile the binary with the hard float abi and also optimise it for size. The binary ends up only 6k, including the icon.

Here’s what it looks like:

volcont pic
Running volcont on Raspbian with JWM

You can download the source code tarball from here. Just extract, compile install and enjoy! It’s distributed under the GPLv2 so you can hack it, share it, do pretty much whatever you like except claim that you wrote it!

Slackware 14 released

Slackware Logo

And … we’re there

– Pat Volkerding, twitter, Friday 28th September, 2012

As many in the Linux world will know Slackware is the oldest surviving Linux distribution. It was started by Pat Volkerding back in 1993. He has remained at the helm ever since.

Announcement.

Slackware’s KISS philosophy is well known. While it is not quite the easiest Linux it’s structure and mechanisms follow a very simple framework.

Congratulations to Pat and the Slackware team.

————————————-

Slacko Puppy has already started the next phase of development based on the binaries of Slackware 14. You can follow development on the Puppy Forum.