Vim hybrid line numbers - toggle absolute/relative in different modes

If the editor is in insert mode or has no focus, it would be nice if the line numbers were absolute.