I was referring to the post before yours as being incorrect on the grounding/switch. Your first schematic would work.
Ole4, is this what you said earlier? You install a diode in one of the AC supply wires, (yellow) with the anode- the straight line on the diode- on the side where the switch is. The yellow off of the switch is then DC positive. Ground comes from the lamp plug via the green wire.
If the LED flickers, install that capacitor with the positive side going to the yellow wire after the diode. The other side of the capacitor would be wired to ground.
?????