My 5 Favorite Free Linux Games

#5 Armagetron Advanced

Linux, OpenBSD, Mac OS X, Windows

If you do not know how this game works, watch this clip from the movie Tron.

#4 X-Moto

Linux, FreeBSD, Mac OS X, Window

You ride around on a motocross bike, collecting strawberries and trying to reach the end of the level. Out of the hundreds of levels, my favorite, so far, is Adventure, which is pictured in the screenshot. I still haven’t beaten it; after the squares, I don’t know what to do.

#3 Wormux

Linux, BSD, Mac OS X, Windows

This is a great Worms clone, but I may have to try Worms with WINE just for the nostalgia.

#2 UrbanTerror

Linux, Mac OS X, Windows

This game is not fully open source! It reminds me a little of Counter-Strike, but it is still a unique game.

#1 OpenArena

Linux, Mac OS X, Windows

Finally, my favorite free game on Linux! Before OpenArena, I didn’t like either deathmatch or futuristic games because the only one I had tried was Half-Life 2: Deathmatch.

Bonus! Frozen Bubble

Linux, Mac OS X

This is my mom’s favorite game. You try to clear the screen by getting three or more same-colored balls in a row, which makes them disappear. Mulitplayer mode is very hard – I didn’t see anybody clear all of their balls. Read More

10 Uses For Your Old Linux Box

I have three old Socket 7 computers in my closet, and one old laptop under my bed, so I have come up with ten things I can use them for. I still haven’t decided, but I really want to play some NES games.

Classic Video Game Console Emulation

Install as many old console emulators as you can find, get some ROMs, buy some Linux-compatible game controllers, connect the computer to your TV, and then play your favorite games from the past.

Home Automation

I know nothing about home automation, so here, have some links:
Home Automation 101 at Linux Home Automation
Linux and Home Automation
X10 Smart Home Automation with a Firecracker and Debian Linux
Home automation in GNU/Linux

Distributed Computing

Donate your computers computing power to a good cause such as finding aliens or curing cancer. Look through this list of distributed computing projects for Linux, and pick one that you think is important.


Install ZoneMinder and connect a few webcams to watch around your house. I was going to use a camera to check who’s there when somebody knocks on the door, but then I remembered I have a peephole.

Pimp Your Phone

Using Asterisk, you can do some awesome stuff such as music on hold and voice mail. To get started, I think Systm episode 5 looks useful, but it’s about 3 years old, so it might be a little outdated.

Kitchen Computer

Install Gourmet Recipe Manager to manage your recipes, then maybe install some games so you have something to do while you’re waiting for the muffins to rise.

Dungeon Mastering

You can open Dungeons and Dragons maps in the GIMP, use a projector to project it onto a table, and then use a layer mask to hide unexplored parts of the map from the players.

Guest Computer

Don’t want visitors messing up your computer? All you need for a guest computer is a browser like Lynx Firefox, so the guest can check their Facebook.

Watch Movies and TV Shows

Connect the computer to your TV, and watch movies and TV shows for free using websites such as veoh. Why pay for cable when you can watch the new episode of Lost a couple days later?

Garage Computer

A lot of hobbies belong in the garage, and depending on what your hobby is, you will have different things on your garage computer. I would have pyrotechnic formulas, but you may have an Ohm’s law calculator or a bookmark to a motorcycle forum.

How To Create A Valid Lightbox with CSS and JQuery


This tutorial will teach you how to make a lightbox effect using CSS and just a touch of JQuery. This how to is not intended to provide cut and past code for a user to implement in their own site; rather it is intended to teach the user how to create a lightbox from scratch and understand the method.

This method has several important goals. First, any Javascript we use must be gracefully degrading (meaning that if a user does not have JS enabled, they can still access the content in a transparent manner). Second, the code we use must be standards compliant. Third, the code must be cross-browser compatible.

Required Materials and Prior Knowledge

This how to is written for a user who is moderately familiar with HTML, CSS, and Javascript. You do not have to be an expert web designer, but this is not intended for someone who is just starting out or relies on a CMS to put out a blag. This method utilizes the JQuery library. However, anyone sufficiently familiar with Javascript can adapt it to their needs without using JQuery.

Understanding This Lightbox Method

This method creates three nesting <div>s. The outermost <div> is the trigger; when it is clicked on it activates the effect. The second <div>, contained within the first, is the overlay, which creates the opaque effect which covers the screen. The third <div>, contained within the second, is the content which we want to display.

The second <div> is hidden from view before the user clicks on the first <div> because it has the CSS property display: none. This property is applied via a class. Because the second <div> contains the third <div>, it inherits the display property and is also hidden.

An example thumbnail for launching the lightbox.

So why not use the visibility: hidden property to hide the lightbox instead of display: none? Because an element hidden with the visibility property still occupies space in the rendering, which will affect the flow of your document.

When the user clicks on the first <div>, we use a JQuery function to toggle the hidden property on the second <div>. When that happens, the lightbox becomes visible, with the overlay occupying the entire browser window and the content centered in the overlay. The application of the class which sets the hidden property is truly toggled on click, meaning that each click on the outermost <div> either applies or removes the display: none property. Since the entire lightbox is contained within the outermost <div>, the user can click anywhere on the lightbox to close it once it has been opened.

For the purposes of this how to, the outermost <div> will have the class .lbTrigger. The middle, or second <div>, will have the class .lbOverlay. The third, or innermost <div> will have the class .lbContent. As well, the class which will apply the hidden attribute will, shockingly, be called .hidden

Gracefully Degrading The Lightbox

Since the lightbox is activated through a javascript onclick event handler, we need a way of providing the same content to a user who does not have JS enabled. We do this by having the content of .lbTrigger be a link to the lightbox content. Normally, an anchor tag’s onclick event will override a javascript onclick event, so when the user clicks on the trigger element, the browser will navigate to the new content. However, we can use JQuery to prevent this default behavior. Thus, if the user has JS enabled, the link won’t work and the lightbox will. However, if the user does not have JS enabled, the link works just fine. Its an elegant solution.

The CSS For The Lightbox

Lets first look at the CSS for the trigger <div>. These properties really only have to do with document flow, and are not relevant to the lightbox effect per se.

float: left;
width: 100%

Next, lets examine the CSS for the middle <div>. Height and width are set to 100% so that it will occupy the entirety of the space available to it. We set position to fixed (not absolute!) so that the space available is the whole of the browser window. Z-index is set to 100, which places it above the containing layer. Last, we use an opaque background image to create the layer effect.

The first point of emphasis is the position: fixed property. I saw a bunch of tutorials that use position: absolute. That would render the element at the top of the document. If the trigger element is far enough down the page that you have to scroll, the overlay element will be rendered above and out of site. By using position: fixed, the overlay will render across the entire browser window, regardless of scrolling.

The second point of emphasis is that I use a background image to create the opaque layer. Many other lightboxes (not all) set the background color to black and then define its opacity property at, say, 80%. However, using CSS to set opacity is not cross browser compatible, nor is it standards compliant if you use browser specific hacks to set it. While I would like to have the performance gains associated with rendering a background color versus a repeating image, those gains are not worth sacrificing standards compliance. Or worse yet using a browser-specific hack. Who else remembers the bad old days of browser wars?

height: 100%;
width: 100%;
position: fixed;
top: 0px;
left: 0px;
z-index: 100;
background-image: url("../images/overlay.png");

Last, here is the CSS for the content element. Position is set to relative so that it calculates against its fixed position parent element. By setting width to 50%, and then left position to 25%, we guarantee that the content div will be centered. You can do the same with height, but for my personal ascetics I like to set the position 15% from the window top. Last, by setting text-align to center, whatever image is in this <div> will be centered.

There are other ways of setting width and centering, and I am not dogmatic about it. This works for a general purpose lightbox whose content may be of varying width and height within reasonable bounds. If you are working with content where the images are of a fixed size, you can specify sizes and use a more elegant solution.

position: relative;
top: 15%;
left: 25%;
width: 50%;
text-align: center;
display: none;

You will see that the class .hidden has just one property. This is the class which will be toggled on and off of the .lbOverlay by the JQuery onclick event.

The Markup

The HTML is straightforward. The trigger contains the thumbnail image, which is also a link to the full size image. (Graceful degradation, remember?) Nested in the trigger is the overlay, and nested in the overlay is the content, and nested in the content is the full size image.

<div class='lbTrigger'>
<a href=’images/yourimage.png’ title=’Your Image’><img src=’images/yourimage_sm.png’ alt=’Your Image’ />


<div class=’lbOverlay hidden’>

<div class=’lbContent’>

<img src=’images/yourimage.png’ alt=’Your Image’ />

</div><!– //lbContent –>

</div><!– //lbOverlay’ –>

</div><!– //lbTrigger –>

The only thing to really notice is that <div class=’lbOverlay hidden’> has both the “lbOverlay” class and the “hidden” class applied to it. The hidden class will be toggled off by the JQuery script.

The JQuery Javascript

This is a very light use of JS for this lightbox. It does only two things: reveals the lightbox or hides it based on an onclick event, and prevents the default behavior of the trigger link. The JQuery library is a wonderful tool for the toolbox, and allows developers to do all kinds of neato whizbang effects on their website, along with really practical things like form validation.

The first step, of course, is to have the library available. Download it and extract it into where ever you keep your scripts. Then add a script element which references it to your head element. For example:

<script type="text/javascript" src="scripts/jquery-1.4.3.js"></script>

Next we are going to write a function to toggle the .hidden class on the .lbOverlay div., as well as prevent the trigger link from its default behavior. I write my JS in a separate file and call it from the head element, which is how this is demonstrated. We’ll call it lb-example.js. Here is the code that goes into that file.

var lightbox = function()
$('div.lbOverlay', this).toggleClass('hidden');

Now that we have the function written, lets insert the script element in the head so that the document can use it. Make sure that it comes AFTER the JQuery reference.

<script type="text/javascript" src="scripts/jquery-1.4.3.js"></script>
<script type="text/javascript" src="scripts/lb-example.js"></script>

Last, we have to call the function when the document is ready. Insert this code into your head, once again AFTER the other two script elements. It should look like this:

<script type="text/javascript" src="scripts/jquery-1.4.3.js"></script>
<script type="text/javascript" src="scripts/lb-example.js"></script>

So to summarize the javascript portion: the JQuery library enables the writing of a simple function that toggles the .hidden class on click and suppresses the default behavior of the trigger link. We add the library and our external JS page to our head, then a call to the function in the head element.

Why Not All CSS?

There are some all CSS lightboxes out there, and I think they are a great idea. However, they work by using the :hover pseudo class, which means that the lightbox is activated simply by the user moving the mouse over the trigger. In my opinion, this behavior upsets users. Hell, I know it upsets me. I want webpages to do things when I click, not when the cat moves my mouse over a picture. (This is why I didn’t like suckerfish menus either.) Until browsers work well with the :active pseudo class to make this happen, using Javascript to fire the onclick event is the only reliable way.


This turned into something of a marathon article, thanks for sticking with it. I hope it helps you to understand the lightbox process, even if you use a premade one.

Andrew Nelson ; First Published: 20 July 2011 under the GPL v3 License.