Depending what you used to edit xorg.conf, if you look in the directory /etc/X11 you may find a file named xorg.conf~ which is automatically created as a backup when you edit the file xorg.conf. So if you have messed up the xorg.conf file then, provided you have not done multiple edits and saves of xorg.conf, your original xorg.conf can be retrieved by typing the following (in a Terminal window if the GUI is still working, or on the command line once you've logged in if it's not):
- Code: Select all
$ sudo cp /etc/X11/xorg.conf~ /etc/X11/xorg.conf
and then restarting. In future you can backup your xorg.conf file before editing it by doing the following:
- Code: Select all
$ sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
Then, once you have done that, you can edit it as you wish:
- Code: Select all
$ sudo gedit /etc/X11/xorg.conf
(I use gedit but you can use any editor of your choice.)
You can revert to the original xorg.conf via the command line in an emergency:
- Code: Select all
$ sudo cp /etc/X11/xorg.conf.bak /etc/X11/xorg.conf
and then restart.