Generalised Bohr compactification and model-theoretic connected components