## Use the xrandr command to get the detected modes

chriswhocodes@debian:~$ xrandr
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 4096 x 4096
VGA-0 connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
  1360x768       59.8  
  1024x768       60.0*
  800x600        60.3     56.2  
  848x480        60.0  
  640x480        59.9     59.9  

## Note the name of the screen, here it is VGA-0 but yours may differ

## Use the cvt command to get a Modeline string for the resolution you want (1280x1024)

chriswhocodes@debian:~$ cvt 1280 1024
# 1280x1024 59.89 Hz (CVT 1.31M4) hsync: 63.67 kHz; pclk: 109.00 MHz
Modeline "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync

## Now copy everything after the word Modeline into the xrandr --newmode command

chriswhocodes@debian:~$ xrandr --newmode "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync

## Now add the mode to your screen

chriswhocodes@debian:~$ xrandr --addmode VGA-0 1280x1024_60.00

## Now change to the new resolution

chriswhocodes@debian:~$ xrandr --output VGA-0 --mode 1280x1024_60.00

## You should now be running at 1280x1024 but you need the next step to make it permanent

## edit /etc/gdm/Init/Default and add the last 3 commands underneath the line OLD_IFS=$IFS to end up with this:

OLD_IFS=$IFS

xrandr --newmode "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
xrandr --addmode VGA-0 1280x1024_60.00
xrandr --output VGA-0 --mode 1280x1024_60.00

gdmwhich () {
...