The problem is that the init scripts don't have access to X services.
Where to run your script can depend on when you want it run - and what display manager. See
here for some of the gory details.
Last I looked at bodhi it used E17, so
this wiki entry should still be valid.