I also had this issue when I used dash as /bin/sh, and from gdm.
In .xsession-errors there were some error messages about spurious
"(". My guess is dash is not happy with bashisms in scripts,
certainly $(. In any case I think that using bashisms in system
scripts is a very bad idea.
--
Pat