Raspbian: Getting Alt-Tab to work properly in Openbox/LXDE

I’m still happily using a Raspberry Pi 2B 3 as a lightweight desktop machine. It’s not my main computer, but it’s pleasantly capable. Set up with a couple of paged desktops (or virtual desktops, as we used to call ’em), I can get a bunch of things done with it.

One feature that really irked me, though, was the way that window switching worked. Or, for greater clarity, didn’t work. Openbox, the standard window manager in Raspbian, didn’t allow you to switch to windows on another desktop with Alt+Tab. As I have a smallish screen, I typically have very few windows per desktop, so I want that ability to move from task to task.

This, however, can be fixed. In your ~/.config/openbox/lxde-pi-rc.xml file, change the keybinding sections for Alt+Tab and Alt-Shift+Tab from:

    <!-- Keybindings for window switching -->
    <keybind key="A-Tab">
      <action name="NextWindow"/>
    </keybind>
    <keybind key="A-S-Tab">
      <action name="PreviousWindow"/>
    </keybind>

to

    <!-- Keybindings for window switching -->
    <keybind key="A-Tab">
      <action name="NextWindow">
        <allDesktops>yes</allDesktops>
      </action>
    </keybind>
    <keybind key="A-S-Tab">
      <action name="PreviousWindow">
        <allDesktops>yes</allDesktops>
      </action>
    </keybind>

Log out, log back in, and Alt+Tab across desktops should Just Work. If you’re not using the default pi user, I suspect you’ll have to edit the ~/.config/openbox/lxde-user-rc.xml file instead.

Credit for this tip: user crunchworksyeay on the CrunchBang Linux Forums.

This has been a Memo To Myselfâ„¢ production.

close, but …

I walked past a store that had replaced its hot table lights with compact fluorescents. It’d certainly save energy, but I have my doubts about its effectiveness.

no, it just isn’t

Finding a source of “Unlimited free energy” would be the most unimaginably heinous crime possible against humanity. For it would inevitably turn the planet into a cinder. Hastening an isoentropic heat death. If you find a free energy source, you damn well better find a new free energy sink as well. Even then, the relative flux rates will still nail you.

 — Don Lancaster, How to Bash Pseudoscience.

pear shaped plan

I fear my plan to have the T21 as a home server has gone wrong. Looks like the mini-PCI network card has blown, leaving it invisible to the network. Since the screen backlight is dead, I can read no diagnostics … ;-(

Update: Aha! The backlight gods must’ve heard me, for the T21 actually graced me with a visible screen for a few hours. It was down to:

  • A bad line in my fstab which was trying to mount an unattached USB drive. This drops OpenBSD into single-user mode.
  • no dhclient configuration, so the machine would not automatically appear on the network. Since I swapped out the purportedly faulty mini-PCI network card for a spare (what?! you mean you don’t have spare mini-PCI network cards about the house? Tsk.) I had to tell the system that this was the new card to get a DHCP address.

So all works now, and I’m happy. Now to attack the LaserJet 4 duplexer, and swap it onto my refurbed printer …

gone with the wind

I see that Americas Wind Energy updated their website to replace the site I wrote for them a couple of years back. It’s purty, but:

  • The page URL sometimes inexplicably switches to d3095932.ejt86.ejtechinternational.com from awe-wind.com.
  • The product page for the AWE 52-750 shows a bunch of non-operational turbines.
  • The AWE 52-900 page also has a picture of a parked turbine, and it looks a lot like Tallon Energy’s 52-750 at Pincher Creek.
  • More parked turbines on the 54-900 page, and occasionally a completely different machine is shown.

Oh wait, I get it – it’s a random turbine image for each page. Hmm.

the commitments

When I was testing BlackBerry typed-alike words (dactonyms?) I found that sqlite was averaging about 1 insert per second. This is by no means good.

It turns out that, under Perl, sqlite auto-commits after every write. This slows things down terribly. Here’s how to fix this:

When opening the database handle, turn AutoCommit off:

my $dbh =
DBI->connect( “dbi:SQLite:bberry2.sqlite”, “”, “”, { AutoCommit => 0 } )
or die “$!”;

Then, only commit occasionally — say every thousand writes:

while ( … ) {

…$id++;
$dbh->commit unless ( $id % 1000 );

}
$dbh->commit;

It works out about 1000 times quicker this way.

ow ow ow

So I’m flat on my back, the air acrid with Bengay. My shoulder’s twingeing like a mad thing, almost like being stabbed.

the monopoly on free money

from a familiar note
It’s a licence to print money! Well, Monopoly® money, that is. But you can’t have everything; it doesn’t stop people from trying, though.

The above image is copyrighted, trademarked, service-marked and intellectually-propertized 15-ways-to-Sunday by Hasbro. I hereby acknowledge that I’m a very naughty person to have nicked it for my website, and have felt good and contrite for at least the last 5 (five) seconds. But then, since Hasbro own the rights to my earliest published writings (long story: they bought Database Publications, for whom I used to write) and are sitting on the goldmine that is the film rights to Stardodger (my first, and only, game), I think they’ve done okay from me.

Mozilla Update :: Extensions: New Tab Homepage

Ah, New Tab Homepage brings happiness to this Firefox user. I rather got to like the lightweight Epiphany browser during my mini-itx odyssey. When you opened a new browser tab in Epiphany, it loaded your home page. The supposedly more advance Firefox never did this.

New Tab Homepage fixes this, and doesn’t add any other tab-related cruft that I couldn’t use.

my lappy is not well

My ThinkPad T21 is dying. Well, its processor and interfaces are fine, but its backlight is erratic, the battery lasts about 20 minutes, and the case is badly cracked. Because it takes so long for the screen to come on, it’s almost no use as a portable computer.

It’s a shame; it has been a nice machine. I’d prefer not to have to buy a new machine — it’s a toss-up between another used ThinkPad, or a new iBook — but this gets me very frustrated. Catherine has been complaining about how tetchy I am about it.

I’ve probably been very bad at responding to e-mail over the last few weeks because of this. Apologies.

mozilla tab coolness

If you have multiple documents open as tabs in the one Mozilla window, you can bookmark the group of tabs if you right-click over the tab bar, and select Bookmark This Group of Tabs.

Next time you open that bookmark, you’ll get all the pages opening in the one window, exactly as they were. Neato mosquito!