Wheel Building

July 3rd, 2008

For the record, it is possible to use a 32 hole hub laced to a 36 hole rim. It is by no means recommended, though it will be a wheel and it will roll. The secret lies in skipping 1 hole for every 8 on the trailing spokes and lining up the leading spokes normally, so they are one hole away from the trailing on the same side of the flange. I followed this pattern and was still able to use Sheldon Brown’s wheel building page as an accurate reference, despite the mismatch.

Debian Lenny Thinkpad config without Gnome - part 2

June 8th, 2008

The next step in my thinkpad drama is hardware monitoring. It’s a laptop, right? I found a way to get battery state, battery charge, system load, CPU tempurature and date/time. DWM is clever with it’s “toolbar” in that it takes a text string via stdin and shoves it into the top right status bar. So how do I get all of this hardware info into a nicely formated single line of text? Here’s how.

Download and compile the tp-smapi kernel modules.

Install this script, taken from minimalblue.com


#!/bin/sh

battery() {
case `cat /sys/bus/platform/devices/smapi/BAT0/state` in
idle)
charge_type="="
time_left="==="
;;
charging)
charge_type="+"
time_left=`cat /sys/bus/platform/devices/smapi/BAT0/remaining_charging_time`
;;
discharging)
charge_type="-"
time_left=`cat /sys/bus/platform/devices/smapi/BAT0/remaining_running_time`
;;
*)
charge_type="?"
time_left="???"
;;
esac
echo "${charge_type}${time_left}"
}
temp() {
awk '{ print $2 }' /proc/acpi/thermal_zone/THM0/temperature
}
load() {
cut -d' ' -f1 /proc/loadavg
}

echo "temp: `temp`C | sys: `load` | bat: `battery` | `date`"

Now you have to launch DWM with this script as an argument to DWM. This is my .xinitrc, as I’m starting my session through startx.


while true; do
$HOME/.dwm/status
sleep 1
done | dwm

That’ll give you a nice status display at the top.

Next up…capturing the thinkpad keys for suspend and brightness, as well as any other arbitrary command you’d like to call.

Debian Lenny on a Thinkpad X61 without Gnome

June 8th, 2008

OMG. Epic drama. I love my new Thinkpad X61. I’m spending an inordinate amount of time configuring it to my tastes. The screen is small and it’s got a small battery, so I set out to find a nice desktop environment that’s light, functional, customizable, CPU efficient and doesn’t get in my way. I settled on DWM.

I’m coming from OS X and Quicksilver. I never liked the OS X window manager so DWM is a real treat. But Quicksilver is pretty awesome and hard to reproduce. I found dmenu. It works in exactly the same way as I use Quicksilver. It doesn’t require any extra configuration. I binded it to the same key combo as Quicksilver, Ctrl + Space. This requires reconfiguring DWM. I also made some other changes to the config file.

DWM is configured by modifying a C header file and recompiling. Here’s mine:

/* See LICENSE file for copyright and license details. */

/* appearance */
#define BORDERPX 2
#define FONT "-*-terminus-medium-r-normal-*-14-*-*-*-*-*-*-*"
#define NORMBORDERCOLOR "#cccccc"
#define NORMBGCOLOR "#cccccc"
#define NORMFGCOLOR "#000000"
#define SELBORDERCOLOR "#AA3333"
#define SELBGCOLOR "#0066ff"
#define SELFGCOLOR "#ffffff"

/* tagging */
const char tags[][MAXTAGLEN] = { "com", "cal", "kvm", "aux" };

Rule rules[] = {
/* class instance title tags ref isfloating */
{ NULL, NULL, "Pidgin", tags[0], True },
{ "Gimp", NULL, NULL, NULL, True },
};

/* geometries, s{x,y,w,h} and bh are already initualized here */
/* func name bx by bw wx wy ww wh mx my mw mh tx ty tw th mox moy mow moh */
#define MFACT 0.55 /* master width factor [0.1 .. 0.9] */
DEFGEOM(single, 0, 0, sw, 0, bh, sw, sh-bh, wx, wy, mfact*sw, wh, mx+mw, wy, ww-mw, wh, wx, wy, ww, wh)

Geom geoms[] = {
/* symbol function */
{ "[]", single }, /* first entry is default */
};

/* layout(s) */
#define RESIZEHINTS True /* False - respect size hints in tiled resizals */
#define SNAP 16 /* snap pixel */

Layout layouts[] = {
/* symbol function isfloating */
{ "[]=", tilev, False }, /* first entry is default */
{ "[]|", tileh, False },
{ "><>“, floating, True },
{ “[M]”, monocle, True },
};

/* key definitions */
#define MODKEY Mod1Mask
Key keys[] = {
/* modifier key function argument */
{ ControlMask, XK_space, spawn,
“exec dmenu_run -fn ‘”FONT”‘ -nb ‘”NORMBGCOLOR”‘ -nf ‘”NORMFGCOLOR”‘ -sb ‘”SELBGCOLOR”‘ -sf ‘”SELFGCOLOR”‘” },
{ MODKEY|ShiftMask, XK_Return, spawn, “exec uxterm” },
{ MODKEY, XK_j, focusnext, NULL },
{ MODKEY, XK_k, focusprev, NULL },
{ MODKEY, XK_r, reapply, NULL },
{ MODKEY, XK_h, setmfact, “-0.05″ },
{ MODKEY, XK_l, setmfact, “+0.05″ },
{ MODKEY, XK_Return, zoom, NULL },
{ MODKEY, XK_Tab, viewprevtag, NULL },
{ MODKEY|ShiftMask, XK_c, killclient, NULL },
{ MODKEY, XK_space, setlayout, NULL },
{ MODKEY|ShiftMask, XK_space, togglefloating, NULL },
{ MODKEY|ControlMask, XK_space, setgeom, NULL },
{ MODKEY, XK_0, view, NULL },
{ MODKEY, XK_1, view, tags[0] },
{ MODKEY, XK_2, view, tags[1] },
{ MODKEY, XK_3, view, tags[2] },
{ MODKEY, XK_4, view, tags[3] },
{ MODKEY, XK_5, view, tags[4] },
{ MODKEY, XK_6, view, tags[5] },
{ MODKEY, XK_7, view, tags[6] },
{ MODKEY, XK_8, view, tags[7] },
{ MODKEY, XK_9, view, tags[8] },
{ MODKEY|ControlMask, XK_1, toggleview, tags[0] },
{ MODKEY|ControlMask, XK_2, toggleview, tags[1] },
{ MODKEY|ControlMask, XK_3, toggleview, tags[2] },
{ MODKEY|ControlMask, XK_4, toggleview, tags[3] },
{ MODKEY|ControlMask, XK_5, toggleview, tags[4] },
{ MODKEY|ControlMask, XK_6, toggleview, tags[5] },
{ MODKEY|ControlMask, XK_7, toggleview, tags[6] },
{ MODKEY|ControlMask, XK_8, toggleview, tags[7] },
{ MODKEY|ControlMask, XK_9, toggleview, tags[8] },
{ MODKEY|ShiftMask, XK_0, tag, NULL },
{ MODKEY|ShiftMask, XK_1, tag, tags[0] },
{ MODKEY|ShiftMask, XK_2, tag, tags[1] },
{ MODKEY|ShiftMask, XK_3, tag, tags[2] },
{ MODKEY|ShiftMask, XK_4, tag, tags[3] },
{ MODKEY|ShiftMask, XK_5, tag, tags[4] },
{ MODKEY|ShiftMask, XK_6, tag, tags[5] },
{ MODKEY|ShiftMask, XK_7, tag, tags[6] },
{ MODKEY|ShiftMask, XK_8, tag, tags[7] },
{ MODKEY|ShiftMask, XK_9, tag, tags[8] },
{ MODKEY|ControlMask|ShiftMask, XK_1, toggletag, tags[0] },
{ MODKEY|ControlMask|ShiftMask, XK_2, toggletag, tags[1] },
{ MODKEY|ControlMask|ShiftMask, XK_3, toggletag, tags[2] },
{ MODKEY|ControlMask|ShiftMask, XK_4, toggletag, tags[3] },
{ MODKEY|ControlMask|ShiftMask, XK_5, toggletag, tags[4] },
{ MODKEY|ControlMask|ShiftMask, XK_6, toggletag, tags[5] },
{ MODKEY|ControlMask|ShiftMask, XK_7, toggletag, tags[6] },
{ MODKEY|ControlMask|ShiftMask, XK_8, toggletag, tags[7] },
{ MODKEY|ControlMask|ShiftMask, XK_9, toggletag, tags[8] },
{ MODKEY|ShiftMask, XK_q, quit, NULL },
};

Next up…fun with menus!

Poetry

May 21st, 2008

gentrification. trillions.

pizza. hamburgers.

keep it real until it's pretend.

bike messenger delivery

1/8th for less than a day's paycheck

adult swim but the pool is already full