The standard way in Unix is to put X initialization stuff in .xinitrc. I've just tried this with LXDE (without Compiz), in several variants, without success. I can't get programs to start and the window manager run properly at the same time. KDE can remember your apps, but there ought to be some way using .xinitrc, independent of the window manager.