Many moons ago, I had to run an update to the nVidia driver for my Kubuntu box. After installing it, I found that the next time I ran X, my display was offset by about 50px to the right. Normally, it would have been possible to fix this via the monitor, most of which have a convenient "auto" button to solve such issues. However, my set-up involves the use of a KVM switch, which allows me to use a single keyboard, mouse and monitor for more than one PC (four in my case). Ergo, I couldn't just click the auto button to sort this issue out as that would mean ruining the display on the other three systems. I was too lazy to search for a fix at the time, but I finally got annoyed enough to fix it last night.
The fix goes as follows:
- Open up Konsole / your terminal of choice and navigate to
- Back up your
sudo cp xorg.conf xorg.conf.pre.xvidtune.
sudo nano xorg.conf.
- Open up another Konsole terminal and type
xvidtune. Read and heed the warning message.
- To make things easier at a later stage, note down all the values listed on a piece of paper or in a text editor.
- Use the left, right, up, down etc. buttons to adjust the display. Preferably, do this one click at a time and use the test button to check the results.
- The values that control horizontal alignment are HSyncStart and HsyncEnd. Similary, vertical positioning is controlled by VSyncStart and VsyncEnd respectively. HTotal and VTotal control width and height.
- Once you are satisfied with the display position, note down the values of the variables you have modified.
- Go back to the terminal where you are editing xorg.conf. Look for something like
Section "Monitor"where you will find a ton of
- Look for the modeline pertaining to your current display resolution - for e.g. 1280x1024. Use the values from step 5 to isolate the correct line.
- Once you have the correct line, you will very likely not know which number to replace with the new variables. Again use the values from step 5 to narrow things down.
- Replace the values with the new values. For e.g., on my machine the original line was:
modeline "1280x1024@60" 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync.
After adjusting my display's horizontal position, the new line with new HSyncStart and HSyncEnd values looked like the following:
modeline "1280x1024@60" 108.0 1280 1348 1460 1688 1024 1025 1028 1066 +hsync +vsync.
- Once this is done, save the file by pressing CTRL + X, close xvidtune and other applications and restart your display manager using CTRL + ALT + Backspace.
- Ideally, you will see your screen correctly positioned now. If you encounter any problems or require more information on
man xvidtunein a terminal to bring up the help page. If you would like to go back to the old configuration, use the backup file you created in step 2 to overwrite the current xorg.conf and restart your display manager again.