Hi I'm looking to set the resolution of X in Ubuntu 9.10 as the system starts up. I have the problem that the screen defaults to 800x600 unless I tell it to use the native resolution of 1366x768 with the following xrandr commands:

xrandr --newmode "1368x768" 85.25  1368 1440 1576 1784  768 771 781 798 -hsync +vsync
xrandr --addmode VGA1 1368x768
xrandr -s 1368x768
I have tried putting these commands in a few places, all of which work... but no matter what I do the resolution is initially 800x600 and only changes to the correct setting *after* X has started. I want it to use 1366x768 right from the start. Any idea in what file I should put those commands?

Hint: it's not
~/.xprofile (that's way too late in the game)
or /etc/gdm/PreSession/Default
or even /etc/gdm/Init/Default

all of those options, though they work, don't change the resolution until late in the game and lots of unnecessary flickering and stretching occurs. This is bad, especially since this particular ubuntu is powering a HDTV that will be seen by many many people...

any help is appreciated.