Running Jelly Bean on the Original Samsung Galaxy S (T-Mobile Vibrant)

Overall, I like my aging T-Mobile Vibrant, but it has been a bit of a mixed bag. When it debuted, the spec sheet made it look like one of the best devices available. It was thin. It was light. It had a big, bright AMOLED screen. It also had as much or more RAM, CPU, and GPU as any other phone available.

The software it shipped with was ridiculously bad. Samsung’s oddball RFS file system was really, really bad. Software updates were slow and rare. I don’t think T-Mobile got an official Ice Cream Sandwich release…

Support from my favorite aftermarket firmware, Cyanogenmod, was slow and very spotty. The phone also has an absolutely worthless GPS chipset.

I don’t want to imply that the phone was terrible. Team Whiskey gave us pretty good Android 2.1 and 2.2-based firmwares, even if the GPS never worked with them.

One third battery left after 24 hours! Even better, 19% remaining after another six hours

Slim Bean Jelly Bean ROM

Fast-forward to today, and things are looking pretty good. I’ve been running the Slim Bean firmware on my phone since version 2.0 and I’m pretty happy with how the Vibrant is running now.

I should qualify that statement a bit. Last year when I bought a (rather awful) 10” Viewsonic G-Tablet, I started relying on my phone just a bit less. Now that I’ve upgraded to a Nexus 7 tablet I’d be surprised if I use my phone more than an hour during any given week. My phone experience can be pretty bad these days and still be more than acceptable.

That said, I do require decent battery life. Slim Bean is giving me more battery run-time than I’ve ever had with any previous firmware. Stand-by battery time has been particularly amazing, even though my battery is more than two years old. I’ve had days where the phone has been off the charger for over 36 hours and the low battery warning hasn’t gone off yet. Those are particularly low-use days, though.

The screenshot above is from a pretty average day around the house, connected to Wi-Fi the whole time. It does phenomenally well in this case. Even with over an hour of screen time I still had over one third of my battery remaining after being unplugged for nearly 24 hours.

On days with a more normal 50/50 split between Wi-Fi and cell data, the battery drains quite a bit faster. Even then it still has no problem staying alive for 18 hours with a similar amount of screen-on time.

My phone is running Slim Bean 2.8 plus the Semaphore kernel.

Is it stable?

Everything except the GPS seems to be working just fine.

Other than that I can’t complain. Scrolling around within individual applications is noticeably more buttery, but switching between apps is still a slow experience. Using the Nexus 7 every day doesn’t help my feelings about that.

What’s wrong with the GPS?

Turning on GPS causes the phone not to sleep properly any more until it is powered off. It will just eat through battery in a matter of hours, even if you later turn off GPS. This seems to have been a problem on every single firmware I can remember using, probably all the way back to the day I opened the box.

When the GPS is on, it is sometimes able to find some satellites and get a lock. Maybe…

Semaphore kernel tweaks

I am running Semaphore kernel on my Vibrant and I’ve made a few tweaks using the Semaphore Manager app:

  • Changed the I/O scheduler to Simple I/O
  • Enabled Bigmem
  • Set LiveOC to 114%
  • Changed to the SmartAssV2 CPU Governor

Even overclocked to 1140 MHz I am still getting better battery life now than I ever did before.

Update 2013-04-16: Upgraded to Slim Bean 4.2.2

I’ve been happily and lazily ignoring the messages telling me that for months. Slim Bean’s little update manager app kept informing me that there was a minor update, but I was happy with how the phone was running and didn’t think it’d be worth the effort to update.

A couple of weeks ago, a friend was picking on me a bit because my aging Vibrant was only running Android version 4.1.2. I told him that there was no 4.2 release of Slim Bean. A few days later, I learned that I was lying to him.

Updating the phone was a snap. I did not reset the phone. I just flashed the Slim Bean, Google Apps, Google Now, and the latest Semaphore kernel zip files and wiped the cache partition. Nothing terribly weird happened, other than one or two icons on my home screen needed to be recreated.

The upgrade seems to have made my old Vibrant just a bit smoother and faster. It could just be my imagination, though.

Automatically Expanding zsh Global Aliases - Simplified

Last year I set up a key binding to automatically expand zsh global aliases as you type. I am definitely not the first person to do this, but I recently discovered a much cleaner way to accomplish the same thing.

globalias demo animation

zsh already ships with a function called expand-alias. I was able to replace the majority of my own code with a call to this existing function. I probably could have almost gotten away with just binding expand-alias to the space bar. For my uses, though, I think this would have been an ugly solution.

I don’t often want to see regular aliases expanded. That would just clutter up my command line too often. I also use the pretty standard practice of using only capital letters in the names of my global aliases. This made it easy to construct a regex as a filter for my globalias function:

globalias code
1
2
3
4
5
6
7
8
9
10
11
12
13
globalias() {
   if [[ $LBUFFER =~ ' [A-Z0-9]+$' ]]; then
     zle _expand_alias
     zle expand-word
   fi
   zle self-insert
}

zle -N globalias

bindkey " " globalias
bindkey "^ " magic-space           # control-space to bypass completion
bindkey -M isearch " " magic-space # normal space during searches

If you’d like to try it out you can just add the above code to your zsh config file, or you can download and source oh-my-zsh plugin.

It should be no problem to loosen up or completely remove the filtering regex if expanding only all-caps aliases isn’t to your liking.

Update: I added zle expand-word to the globalias function. I have one or two global aliases that end in a file glob. This makes them immediately appear expanded.

A Quick Comparison of Gesture Keyboards for Android - 2012 Edition

I’ve been using Swype for quite a few years now. I am a really big fan of Swype and I don’t think I would be happy without a sweeping/gesture-based keyboard. I recently learned about a keyboard, called Keymonk, that allows you to gesture with two fingers at once. I’ve been using the free version of Keymonk for almost a week now and I have been mostly happy with it.

Today I installed the stock Android 4.2 keyboard on my Nexus 7. This new version of the default Android keyboard also allows for gesture-based typing.

Swype

I’ve used Swype for a long time and I am very fond of it. Of the three gesture-based keyboards I’ve tried, Swype is definitely the most accurate of the bunch. There are often times when I know that I’ve completely botched up the spelling of a word very, very badly but I just keep going and Swype more often than not guesses exactly what I was trying to input.

One of my favorite Swype gestures is sweeping above the keyboard to capitalize a letter. I try to do this on the other two keyboards all the time.

Swype is currently free but you have to sign up for an account, download their installer, log into their installer, and then finally install Swype. I’d be willing to pay to not have to jump through these hoops every time I get a new device.

Keymonk

Keymonk allows you to use two fingers (likely thumbs) to input words. I’ve had a lot of fun thinking up words like “inconceivable” and “indubitably” to input with both thumbs. It is a little confusing at first but I’m starting to catch on a bit. I might be typing faster with two thumbs now that I do with one finger.

Fortunately, you can use Keymonk one-handed, just like Swype. I also like the way Keymonk highlights the key your finger is currently touching during your gesture. This makes it easy to see when you are overshooting your target.

Keymonk also feels like the fastest of these three keyboards. It pops up much faster than Swype on my old Samsung Galaxy S. It even pops up noticeably faster than either of the other two keyboards on my Nexus 7.

Keymonk’s method of inputting numbers and symbols is superior to Swype. You can still tap shift/numlock and peck away at numbers like with any other keyboard but you can also gesture from the numlock key straight to the desired number/symbol. Punctuation input works in a similar manner.

Since I’m only currently using the free version of Keymonk, I am not able add words to its dictionary. The free version also does not automatically insert a space after punctuation. That bites me a lot because I’m in the habit of Swype doing this for me.

The quick load time, better number/symbol input, and the lack of an annoying installer/updater may very well be worth the four bucks. I think I’d like to see an update or two before I commit to using Keymonk on a more permanent basis, though.

The new Android 4.2 keyboard

The new Android keyboard isn’t bad, but it sure isn’t Swype. It seems to do an even worse job of guessing the correct word out of my random flailing about as Keymonk.

Along with Swype’s capitalization gesture, I find myself very much missing Swype’s “punctuation to spacebar” gesture for quickly inserting punctuation. Keymonk has its own gesture that fills this role.

It is interesting how the Android keyboard prints the partial word that you’ve spelled above your finger and it follows you around as you gesture. I’m not certain how useful that is, though, because my finger moves around pretty quickly. It also gently lights up the key your finger is hovering over, similar to Keymonk.

Which keyboard should I use?

In my opinion, Keymonk doesn’t have far to go to catch up with Swype. I wanted to wait for Keymonk to be updated once or twice before buying it, but writing this post has just about convinced me that the advantages of Keymonk might be worth buying.

Update: Keymonk seems to be dead

I’m pretty disappointed that Keymonk hasn’t been updated in over a year. I still try to use it every once in a while, but it is pretty buggy on newer versions of Android. It will randomly stop responding to gestures and stop suggesting words.

I’ve never actually measured my typing speed with any Android keyboards, but when I use Keymonk it feels like I’m typing much faster. I really miss that.

Cocktail Arcade Cabinet Build: Postmortem - The Things We Got Wrong

I’m very happy with the cocktail cabinet that we built. It was a lot of fun to build and it is even more fun to play!

I made a few less-than-optimal choices in the design of this cabinet. I’m not going to call them mistakes (except maybe the choice of monitor). I’ve had a chance to visit an arcade or two since the cabinet was finished. I was worried that seeing a bunch of real arcade machines would make me disappointed in our work.

My feelings while visiting those arcades were actually quite the opposite! In most ways, our cabinet looks much, much better than the majority of real, old-school arcade machines. The most noticeable difference is the lack of artwork on our cabinet. This was our choice and it fits in with everything else in my office much better this way.

Here’s a list of some of the things I might have liked to do differently.

Test fitting joystick under unpainted plexiglas

The buttons are fine, but the joysticks…

When I was shopping for parts, I primarily had the Mortal Kombat series of games in mind. The HAPP joysticks I chose seem very much like what I remember from my days of playing Mortal Kombat II back in high school. They have the right shape and feel. You can even get Raiden to teleport by pulling the stick towards you and letting it fly out of your hand, just like on the real cabinet.

The HAPP joysticks aren’t terribly precise, and the quality of each of the four joysticks I bought varies quite a bit. My player-one controller likes to make an odd clunk when you push it to the left… It will engage the switch, feel like it is at the end of its throw distance, then it will clunk and move a tiny bit more. All of them do this sort of thing some of the time, but not nearly as often as player one.

I haven’t actually played much Mortal Kombat. I’ve spent more time playing modern indie games than I have spent playing actual old-school arcade games. These big, imprecise joysticks with their longer throw aren’t very well suited to anything besides Mortal Kombat and other similar games.

I would definitely choose a different joystick.

Arcade cabinet joystick close up

The table is too tall

I wanted an adult-size cocktail table with a bit of leg room. We got the controller height right—there’s about an inch of knee clearance under the control box when you sit down at the table. I miscalculated on the amount of vertical clearance we needed between the control panels and the glass tabletop.

I was aiming for 5 ½” of clearance. We ended up with 5 5/8” of clearance. That’s 1/8” more than we were hoping for, and that ended up being almost 2” more than is really necessary. That would put the cabinet at a more usable height of 32 inches instead of the 34 inches we ended up with. Most tables and desks are 29 to 30 inches. Our cocktail cabinet is approaching counter top height, which is usually about 36 inches.

If we had to, we could probably squeeze a half-inch or more out of the depth of the control panel boxes, too.

Yardstick included to show scale

Quarter inch glass is a bit thin but it works

I’m very glad that we went with glass. If we went with plastic it would have had to be very thick to be rigid enough to work with our design. To use acrylic we would have had to support it from underneath with wood or particleboard, and that would have made the table even taller.

The quarter inch piece of glass we used was surprisingly inexpensive. Our 32” by 42” piece of glass with rounded corners cost less than $60 from a local shop. A thick enough piece of plastic would have been way more expensive and we would have had to radius the corners ourselves. Definitely check your local glass retailers because this was way less expensive than the glass we were finding on the Internet. All the good Internet prices were on certain pre-cut sizes. We had ours cut to exactly the dimensions we wanted.

The thin glass has made me nervous on more than one occasion. When I saw someone sitting at the end with their elbows on the table and putting a bit of weight on it, I couldn’t believe how much the glass was flexing. With our large surface we probably should have gone with 3/8” glass.

Some buttons are installed

Some molding problems

We have a pair of ninety-degree bends in the t-molding at each control panel. The problem is that there is only about an inch of molding after the bend. You can see it popping out a bit in the above picture. We ended up having to glue some of these small sections in. If I had anticipated this problem I would have eliminated it from the design.

I’m also unhappy that I have one seam where I have a single piece of molding circling the entire cabinet at the control panels. The seam is in the center of the player-four seat, and I currently have that side up against the wall. I don’t like knowing that it is hiding back there, though. Unfortunately, I don’t think I could have designed this one away. That single ring of light blue molding is one of my favorite features of the cabinet.

Close up while applying the sticky-back vinyl

Stick on vinyl…

The sticky-back vinyl looks and feels great. In my opinion, it is too expensive and it is much too time consuming to apply it. Due to the high shipping costs, the vinyl was over 20% of the total cost of the cabinet (and I almost goofed up; we barely had enough to cover the cabinet).

It also took a very long time to cover the cabinet. The cabinet build took us a very large number of hours. I think if we did it again, most of the steps would take half the time, but not on the vinyl. You have to be very meticulous when you put it on, and trimming all the edges perfectly takes a lot of time.

I would like to try using melamine board on the next cabinet. It is only a bit more expensive than particleboard, but even if we had to paint it we’d save a ton of time compared to using vinyl.

Finished cabinet with the lid off

Choose the right display

I already wrote about the problems with my choice of monitor, it only has a good viewing angle from three sides. If I build another four-player cocktail cabinet I will probably use a 26” or 32” LCD television. However, because of the asymmetric vertical viewing angle of an LCD monitor we are probably getting a better view right now at the player-three seat than we would with even an IPS display.

I’m not sure if I would build another four-player cabinet. Most of the time we play one or two-player games. With the size of our table it is more convenient to play single player games from the player one seat with the screen split with MAME’s cocktail mode.

Outside of MAME and MESS, this isn’t an option. All the other games have to face the player three seat. This means that all native games are effectively limited to one player.

A trackball would have been useful…

I really should have included a trackball. I thought it would be a bad idea to put one underneath a sheet of glass and in such a small, enclosed space.

I’ve been playing more native games on the cabinet than emulated games. Most native games require a mouse for something, even if it is only to start a new game. I’ve been doing a reasonable job cheating at this, but it is a pain in the neck.

Shell Environment Upgrade and Cleanup: Part 2 - Migrating from oh-my-zsh to Prezto

My migration from oh-my-zsh to Prezto actually began quite some time ago, and I accidentally made things much more complicated than they needed to be. I was completely switched over while Prezto was still a fork of the oh-my-zsh github repository. At some point in time, Prezto was moved to its own repository.

I happened to not be paying attention at the time, and my local copy of Prezto got way out of sync. Merging was going to be quite a headache. This seemed to be the perfect time to start fresh and only move what I actually needed from the old repository to the new.

Migrating oh-my-zsh’s custom directory to Prezto

I currently have 16 scripts that were in my ~/.oh-my-zsh/custom directory. They’re mostly bite-sized, ranging in size from a single line up to a few dozen. I took the lazy way out here and created a Prezto module called custom.

Useless little screenshot of Prezto for zsh

I moved all my scripts from ~/.oh-my-zsh/custom/ to ~/.zprezto/modules/custom/scripts and created an init.zsh to loop through and sort them all.

init.zsh:

for file in /home/wonko/.zprezto/modules/wonko/scripts/*.zsh; do
  source $file
done

It is pretty simple but it is getting the job done.

Next step: Persistence of config files

I already wrote a small persistence module that I’m using but it is only just barely half-baked at this point. I have a basic persist command to automatically store files in a git repository and I have a forget command to restore them to their previous state.

They work, but their error handling still needs work. I’d hate to release this and have someone lose a file because of a stupid bug.

It also still needs a higher-level command to globally restore all the persisted data on a new system. A command to revert all persisted files back to normal files wouldn’t hurt, either.

I haven’t been working on this part at all. I got too distracted working on zsh-dwim. zsh-dwim is quite a bit more interesting and, for right now, I’m much more excited about it!

Cleanup of zsh-dwim

I went ahead and cleaned up zsh-dwim (Do What I Mean) quite a bit. If you haven’t been following along, zsh-dwim attempts to predict your intended next command when you hit control-u. I also recorded a short screen cast demonstrating some of what happens when you hit control-u.

Removing the Perl dependency

I decided that I may as well bite the bullet and move all the transformation logic to zsh from the original Perl “helper” script. Early on, I was worried that zsh code would be too ugly, but I have too many ideas that would be hard to implement with the code base split up like that.

All the transformation logic now uses zsh and sed. I was hoping to use zsh’s built-in substitution abilities, but they were lacking some important features. The “scp to mv” transformation looked like it would have been really ugly without sed.

Cleaning up the if/then spaghetti

When I was testing this idea I only had two transformations, so a pair of if/then statements didn’t seem like a problem. Now that there are ten, it is starting to get ugly.

I ended up moving all the transformation definitions into a zsh hash and I created a little helper function to add new definitions to that hash. When you call zsh-dwim, it loops over that hash testing for relevant transformations. This means we can now add transformations anywhere in our shell configuration.

Adding a transformation looks like this now:

  _dwim_add_transform '^mkdir ' \
    'BUFFER=$(echo $BUFFER | sed -re "s/^mkdir /cd /")'

What’s coming down the road?

There’s still a lot of repetitive nonsense to eliminate. I need to factor out all those “BUFFER=$(echo $BUFFER | … )” bits. They’re repeated in every single transformation.

I’d also like to make use of more data in deciding which transformation to run. For instance, it might only make sense to call ssh-keygen if the ssh command fails.

The zsh-dwim repository is ready to be pulled into Prezto as a git submodule. It can probably be used as a plugin with oh-my-zsh pretty easily, and the init.zsh file can probably be sourced right into plain old zsh without, hopefully, any problem at all.

Initial Release of zsh-dwim

I’ve had a small idea rolling around in my head for while now. While operating in a shell, there are certain commands that often follow others. Sometimes there is a problem. You attempt to ssh into a host and it fails due to a host key mismatch, so you need to run ssh-keygen to remove the key. This happens to me fairly frequently when I am building temporary virtual machines.

Sometimes one command tends to follow another in chronological order. You might list the contents of an archive and then want to extract it. Maybe you stopped a service and want to start it back up shortly thereafter.

I thought it would be nice to bind a key to attempt to insert the next command that I’m going to be looking for. I’m sick of changing ssh to ssh-keygen, adding the -R, and removing the username@ from an ssh command to remove its host key from my ~/.ssh/known_hosts file.

What’s working so far?

The code is ugly, but I have a few useful things working. For instance, commands like these:

1
2
3
service apache2 stop
ssh crazylongusername@blog.patshead.com
apt-cache show apache2

…turn into commands like these when you hit control-u:

1
2
3
service apache2 start
ssh-keygen -R blog.patshead.com
sudo apt-get install apache2

If the command line is empty, the previous command will be recalled from history first.

How does it work?

There’s a little zsh function that passes the command line to a Perl script. The (rather ugly) Perl script runs through a list of possible transformations and returns the new command back to zsh.

Why isn’t it all in zsh? Why is the Perl script a disorganized pile of conditionals?

The Perl half started as a quick hack just to see how workable this idea was. I enjoyed using it quite a bit, so it ballooned up fairly quickly. I started the job of porting it back into zsh before I posted the code up on github. It didn’t look like zsh’s regular expression capabilities were very advanced or easy to use. I may be wrong about this. I may have been looking in the wrong place.

That doesn’t explain why it is still if after if after if. I thought about moving all the regular expressions out to a config file, or at least setting up a dispatch table. I thought it would be best to wait and see if any more complicated transformations pop up.

Why control-u?

Why not? I wanted to use something easy to reach and the default binding for control-u was something I never use.

Where will it go from here?

I’m not sure. I mostly come up with ideas as I’m working in my shell. I’d like to set up some more circular command lists. There a group of about four or five ls commands in there now that loop back around to the beginning. I’m thinking I might do something similar for dig/ping/mtr, and I bet there are plenty of related commands like that that all take similar arguments.

I’d love to hear some ideas!

Where to get it

I uploaded the repository to github, and the README explains how to get it.

I have it set up to install directly into Prezto, but it should be pretty trivial to get it to work as an oh-my-zsh plugin or on its own without any fancy configuration framework.

Inexpensive Universal 120-Watt Laptop Power Supply

I created a problem for myself late last year. I drove almost nine hundred miles and left my laptop’s power supply at home. It seemed like I had three choices.

  • Drive to the local Fry’s (or similar) and buy a new one
  • Have someone go find my power supply and ship it to me
  • Order one and wait for it

I checked the websites of a few local stores. My gargantuan laptop requires a rather huge 120-watt power supply. As it turns out, these are quite rare and the only one that might have existed locally was pretty expensive. Some quick math told me that I could have one delivered over night for a good bit less.

That left me with two options. I’ve been saying for years that I should have a spare, universal laptop power supply that I can just keep in my laptop bag. This seemed like a good excuse to get one.

I ended up ordering this “Syba 120W Universal Notebook AC to DC Power Adapter with 11 Power Tips”. I was hoping to find one with a USB charging port, but there wasn’t really a ton of selection at 120 watts. Also, in agreement with the pictures on Amazon, the charger actually has the brand name “Spyker” on the side.

I’ve had it for nearly a year now and so far it has been working just fine with my HP DV8T laptop.

The box has a list on the back specifying which tips work with certain makes and models of laptop. I had the brillant idea to take a picture of the list before I discarded the box. I should have looked at the picture first.

Native Linux Games for an Arcade Cabinet: Irukandji

I feel like I’ve done Charlie over at Charlie’s Games a bit of a disservice here. I am pretty sure Irukandji was the very first native Linux game I purchased for my arcade cabinet. Since that day, nearly two years ago, I’ve written about over a dozen of the games I’ve installed on my arcade cabinet. Some of those games aren’t even actually native to Linux!

Irukandji on the WahCade menu Big glowing fish Lots of small, glowing fish My terrible score

I recently went though two years’ worth of OS upgrades and I have also been tweaking all my games to work properly with my arcade cabinet’s new secondary display. When it came time to configure Irukandji I ran into a few problems.

At first, all was well, except that I had no sound. I don’t recall this being a problem before my OS upgrade, but I can’t say with absolute certainty. My arcade cabinet had an older version of Irukandji installed, so I upgraded it.

This fixed the sound, but as soon as I set it to run full screen it would segfault. I had the same problem on my laptop. I exchanged a few emails in the middle of the night with Charlie. He was extremely helpful, and he very much pointed me down the right track when he explained to me that Irukandji runs natively at 800x600.

With that information in hand it was a simple matter to use disper to set the television output to 800x600 with “aspect ratio stretching.” The NVidia driver is now actually driving the television at 1280x720 but stretching the virtual 800x600 display up to the correct size.

The controls

Irukandji is one of those games that is awesome enough to not require a single mouse click to control. Moving around the menus is done with the arrow keys, and choices are selected with the “fire” button. Easy peasy.

There is only one tiny problem I have. I had to map buttons to the “enter” and “q” keys. “Q” is used to quit the game. I needed to map “enter” to confirm the submission of my excellent high scores.

I’m very good at hitting “q” instead of “enter.” If you see any names in the high score list with large quantities of the letter “q” at the end, those are most likely me.

The game

The game is quite awesome on an arcade cabinet. It is another shoot ‘em up, and I can never get enough of those. I seem to be collecting quite a few games with these shiny, glowy, neon graphics. They always look right at home on an arcade cabinet.

I didn’t get to play this one much when the arcade cabinet was new. My video flipping requirement made the game slow down quite a bit with my original video card. I’m hoping to rectify that situation in the upcoming weeks!

Space Phallus

I had previously avoided installing Space Phallus on the arcade cabinet. Before we moved, our young six-year-old nephew used to play games on the arcade cabinet pretty regularly. I didn’t really want to have to be the one to explain what a phallus was, what it was using as ammunition, or what it was firing at.

I don’t have to worry about that now. Space Phallus will hopefully be making its debut on my arcade cabinet in the near future.

Scoregasm and Bullet Candy Perfect

I wish I planned a bit better. Twin-stick arena shooters almost never fit my control layout. Even if I had a pair of arcade joysticks at any of the seats, they’d often be difficult to use for most twin-stick shooters due to the fact that they’d be digital controls.

Maybe Scoregasm or Bullet Candy Perfect will fit on my next arcade cabinet!

Yet Another Shaky Cameraphone Video

Thank you again, Charlie, for helping me get your excellent game back up and running on my arcade cabinet!

Shell Environment Upgrade and Cleanup: Part 1 - Requirements and Planning

My ~/bin directory and Bash configuration had been slowly growing since some time around 1998 or so. Every few years I would cut back the weeds, but it had definitely been steadily growing right up until I switched to zsh a few years ago. That gave me an opportunity to cut pretty deeply and throw out a lot of cruft that I just don’t use anymore.

It has been a few years, and I think it is time to do a little weeding again. I would also like to try to make some improvements and additions.

Some of the goals

  • Clean up my zsh configuration
    • only define aliases for tools that are actually installed
    • move away from oh-my-zsh
  • Better, more automated revision control of config files
  • Single command to install my config on a new machine (like ssh-copy-id on steroids)
  • On new machines, automatically install
    • Required infrastructure (zsh, git)
    • Commonly used programs (ack, bwm-ng, autojump, tmux, etc)

Moving past oh-my-zsh

I really like the layout of oh-my-zsh’s directory structure. I used to maintain a single, large .bashrc file full of random aliases, functions, and environment variables. With oh-my-zsh, any file I drop in ~/.oh-my-zsh/custom/ will be included for me. I have a few hundred lines of code in there spread over two dozen files.

I’ve run into a problem with this several times, though. oh-my-zsh loads your custom config files first, then it loads its plugins. There have been times when I want to override just one little alias or settings that a plugin sets up for me, and the cleanest way to do that seems to be editing the plugin.

Tracking changes to files that ship with oh-my-zsh is made easy by git, but it doesn’t feel very natural to have to do this with oh-my-zsh… I’m equally happy maintaining my own fork of oh-my-zsh or just maintaining a set of configuration scripts within oh-my-zsh. I don’t think I should have to do both.

I’ve already begun switching to Sorin Ionescu’s Pretzo, which is a fork of oh-my-zsh. Sorin has eliminated oh-my-zsh’s line between plugins, libraries, and custom scripts. Everything in Pretzo is a “module.”

Better revision control of configuration files

Today I am maintaining four git repositories for files in my home directory. One each for ~/.oh-my-zsh, ~/bin, ~/.sawfish, and ~/.emacs.d. My ~/.xsession file lives in ~/.sawfish with a symlink back to my home directory. I used to keep my .bashrc in ~/bin but my .zshrc lives in my oh-my-zsh repository.

I came across a really great idea while investigating oh-my-zsh forks. It seems to have completely vanished from the Internet since I found it, though. He had a pair of scripts called persist and forget for moving configuration files into a git repository and leaving behind a symlink in their place.

He didn’t push the idea as far as I would have liked. His implementation could only store individual files. I would like to be able to persist entire directory trees with a single command. I also need a way to recreate the symlinks on other machines.

Pushing my shell config and ssh key to new machines

I’m a big fan and a heavy user of ssh-copy-id. It is a good, lazy way to push your public key out to a new server. I’d like be able to run a single command to push my ssh public key and my entire shell config out to fresh servers with a single command.