Where do you pick up the earth and 12v from?
The earth can be taken from the door itself by attaching the wire behind one of the nuts in the door panel.
The courtesy light is also used as a constant 12v because the + wire is always 12v, its the -ve that's switched.
do they come on if you unlock the car? or is it when you open the door?
They're triggered by the courtesy light, but there's no reason why they couldn't be triggered by the interior light (which comes on when you press unlock on the fob).