To keep this short and simple, I hadn’t used my netbook for a couple of days and it turns out I had installed xbindkeys. Probably in a case to get a key working as a shortcut for something, but never getting beyond actually installing it and creating the default config as the program suggests by running xbindkeys –defaults > ~/.xbindkeysrc. This just happens to enable 3 default keybindings, one of which is Ctrl-F (!?) to open an xterm. It also grabs that shortcut, and it no longer does its usual task in the program you’re running.

It also ignores xkb keyboard layouts, so for me using dvorak that means my Ctrl-U shortcut just disappeared, no more delete line of text in terminal, yay!

Fortunately I worked out that my issue was with Ctrl-F and a google search for that and xterm keyboard shortcut lead me to a where some poor sob had also run into the issue, but had worked out that xbindkeys was the culprit.

I’ve filed a wishlist bug report on the Debian BTS, but I doubt they’ll see it as something worth fixing.

 

I have run into a couple of shell scripts that print terminal colours as blocks of colour or text but none have been formatted in a way that showed a terminal colour scheme that well. Recently I have taken up adopting the solarized colour scheme but I’ve been trying to modify it slightly to suit my tastes and have had trouble discerning what colours were what, as some colours are replaced with different shades of grey.

Reading the debian planet I came across Antonio Terceiro’s post on a neat simple shell script to print out all the ANSI colour codes and I really like the formatting, so I want to save it here so I don’t forget.

#!/bin/sh -e
 
for attr in $(seq 0 1); do
  for fg in $(seq 30 37); do
    for bg in $(seq 40 47); do
      echo -n "\033[$attr;${bg};${fg}m$attr;$fg;$bg\033[m " 
    done
    echo
  done
done
 

Occasionally I need to extract a source tarball to a subdirectory without its leading path directory and every time I need it I forget the necessary GNU tar switches, so here is todays lesson in the two tar switches required.

tar --strip-components 1 -xvf package_1.1.tar.bz2 -C package

“–strip-components 1″ will strip off the first (1) folder of the archives path. Replacing 1 with 2 will do the obvious and strip off 2 folders/preceding path components.

“-C package” is nice and simple, it will extract the archive into the folder package. You could be fancy and do “-C ~/source/package” and extract the archive anywhere you fancy.

© 2012 Linux Sand Garden Suffusion theme by Sayontan Sinha