Entanglement entropies of inhomogeneous Luttinger liquids