First off, open a terminal and type xrandr, scroll up and it'll show the name of your display here:
Then for your program, you'll want to make a launcher on your desktop or something, and for the command line use this template:
bash -c "xrandr --output VGA-1 --mode 640x480 &&...