Posts

Showing posts from April, 2008

Unison Bash Completion

If you don't use unison to keep folders synchronized you really should, it's great. It's like a two way rsync program.
Problem is I end up synchronizing a bunchy of folders in different locations for different projects and I prefer to start unison at the command-line. What I want is bash completion for unison. It's not that difficult to setup.
I just created a file in /etc/bash_completion.d called "unison" and it looks like this:
_unison()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
opts=$(python -c 'import glob,os,os.path;x = glob.glob(os.path.expanduser("~/.unison/*.prf")); print " ".join([os.path.split(y)[-1][:-4] for y in x])')

COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
}
complete -F _unison unison-gtk
The python part is all one line and it goes to my ~/.unison folder, lists all the *.prf files and then just gets the base name…

Upgrade to Hardy Heron (Ubuntu 8.04)

This Monday was a holiday here so I thought it might be a good time to upgrade my Linux, a couple of days before the official release. It took a long time to download all the updates, but it seemed to get everything and then started the installation process. I went inside to finish the last few episodes of Lost, I finally watched all 4 seasons of after beginning about a month ago. I have to say that the 4th season is a letdown so far. I mean seriously, you need to have an emotional "constant" for time travel? That really made me cringe, the writers need to stay as far away from math as possible.
When I came back to the computer to see how it was going I was at 1% and got an error already. I spent the rest of the night clicking "OK" buttons because it kept finding problems with the install. After a hundred of these it gave up and it quit the upgrade. But by that time, I had already started noticing that things had stopped working, like Gnome Nautilus, ugh.
So …