A fork of barwap's intelligent display code.