Friday, October 12, 2007

Cool OS-X program

There is a great program called Witch which basically is an improvement on Windows style ALT-TAB.

Monday, October 8, 2007

Setting Up Environment Variables in Ubuntu (and probably Debian)

I was having problems getting my environment set up correctly when logging into my Ubuntu machine from the gdm login prompt. The nature of the problem is that bash is never started unless you create a terminal window. If bash is never started, then ~/.bashrc, ~/.bash_profile, etc., never get run. For many people I suppose this isn't a problem, but for me, when I start Emacs via the drop-down menus in the window manager, I wanted my environment variables, like PATH and various perforce environment varaibles, to be already loaded.

The solutions on the web I found in the top 100 google hits for (ubuntu enviornment variables) were all pretty terrible as they suggested changing the system wide settings in /etc/profile and other things that would make it harder for me to use other machines in my organization.

The solution I am using instead is to create an executable ~/.Xsession file which sources the script which sets up my environment variables and then execs /usr/bin/x-session-manager. In between, it is convenient to launch a few extra programs to run as well. So here is my script:


#!/bin/bash

# Force environment variables to get loaded before our window manager starts.
# Perhaps I should just load .bash_profile here but .bashrc will load that
# automatically if necessary.
source ~/.bashrc

# Start up some programs here.
xterm &

# Now, invoke the normal gnome/ubuntu login stuff.
exec /usr/bin/x-session-manager


Hope this saves you a little time and frustration.

Friday, September 28, 2007

OSX Terminals

I'm still looking for a good OS-X terminal. The major problem with Terminal.app is that after poking around, I'm only able to get the meta-key as alt/option. Of course, my carbonized emacs uses the clover leaf for meta so if I'm sshing somewhere and using emacs and using it locally too, I'll end up typing clover-leaf commands at Terminal.app which causes it to do funny things. There are programs that switch alt/option and clover leaf, but they do it globally. I just need to switch it per window, but I don't know how.

I'm trying to avoid installing X-Windows on my mac because of the problems I seem to have with it (namely that it is very slow to start and its windows don't seem to get integrates into the aqua ui for things like clover-leaf tab.

Update: I built my own version of iTerm hacked so that both Alt and Option act as a "Meta" key. It works pretty well though I've mostly resorted to using XWindows when logging in from home because I have better control over the colors.

I'd like to formally complain that the people who came up with ANSI coloring for terminals didn't do something smart like being able to query the terminal for the RGB triples it supports (of course with a shorthand for any) and be able to then specify colors by RGB triples when drawing.

Bold, italic, underlining, and strike-through, would be nice too. (A single fixed width font is fine however, after all, it is only a terminal, not a web-browser.)

Thursday, September 27, 2007

Mercurial

My friend has been trying to use Mercurial which is a version control system written in python. I'm using OSX and I already had python 2.4 installed. While some of the files seem to appear after doing an install of mercurial package, the executable itself never gets installed (and the installer never complains). I was mislead by the documentation and by spotlight. Doing a find I fould hg, a very simple script, in /usr/local/bin. I gave it a spin and it seems to work OK.

I still don't know why the world can't just learn from Apple that installation should be a matter of dragging a single folder into any directory you want. I wouldn't even care if it carried with it the 100mbs of a python as long as it would just work.

About Me

My photo
I'm currently a software engineer at Google though I've worked at other companies as well.