Electrostatic modes in (self-gravitating) dusty plasmas with charge and mass distributions