Quick fix for damaged Xorg.conf

by vampirefo

My one daughter was trying her hand on updating her graphic card drivers and got locked out of Kde, eg, she damaged her xorg.conf. LOL we all been there.

So I wrote this for her so she can at least get her desktop back.

How this works:

  1. Go to /etc/X11/xorg.conf as "root", right click xorg.conf, select copy, then name the copy xorg.conf.bak
  2. Copy and paste the script found below into Kwrite or your favorite editor and save in /. I called hers "fix_xorg", call yours what you want.
  3. When you have a problem and you can't login due to xorg.conf problems you just get a command login, type root <Enter> and then your root password <Enter>.
  4. Next, just type /fix_xorg or what ever name you called it, and in just a few seconds you should be in the root Kde desktop.
  5. You can now just end session and type reboot if you want and after reboot login to your user account.
  6. Each time you make an adjustment to your xorg.conf and you like the adjustment, and you can login, just delete your old xorg.conf.bak and make a new one from your current working xorg.conf.
  7. This way you always have a backup of your most current working xorg.conf, just in case something goes wrong, you can quickly fix it.

Script:

#!/bin/sh
filename=/etc/X11/xorg.conf.bak
if [ -f "$filename" ]
then
rm -f /etc/X11/xorg.conf
cp /etc/X11/xorg.conf.bak /etc/X11/xorg.conf
sleep 2
startx
fi
mypclinuxos

Top