Hmm, maybe do ``if file.startswith(home): file.replace(home, '~')`` type code (yes that code is wrong but you get the idea).