-   Linux - Newbie (
-   -   fixing a corrupted xinitrc file (

Castanea_d. 05-25-2007 03:29 PM

fixing a corrupted xinitrc file
I don't like the default screen resolution on my X screen – I use an old 14” monitor, and while it runs with a nice high resolution, text is microscopic.

I learned to change the resolution by running

<xrandr -s 800x600>

which is the resolution that looks best for me.

But (I thought), wouldn't it be nice to make this the default resolution?


To make a long story short, I managed to corrupt my <.xinitrc> file to the point where <startx> no longer works. At least I was doing it as a user, and not as root.

There are probably elegant ways to fix my screwup, but I am too dumb to find them. Instead, an ugly kludge: Create a new user, and copy the new user's file over the corrupted one. This restores the defaults.

So, <adduser castanea2> and do all the usual things of entering a password (same as <castanea>, since I have a small memory), etc. I checked, and sure enough, <castanea2> could run <startx>, complete with the microscopic text.

Now, copy the file. This has to be done as <root>. What you are looking for is </home/castanea2/.xinitrc>, which you will copy over </home/castanea/.xinitrc>.

So, my Dumb Questions of the Day:

1)Is there a better way to restore corrupted user configuration files (besides the obvious one that I forgot to do: make a copy of said file before puttering around with it – I thought “I'm just making a little change; I don't need to make a backup for something this simple...)?
2)Is there a way to change the default screen resolution?

All in all, good lessons for this newbie: Never Fiddle Around As Root, and Always Make Backups.

Emerson 05-25-2007 04:00 PM

1) Yo really can't beat the backup method ;)
2) A good way to change X server parameters is editing /etc/X11/xorg.conf.

Castanea_d. 05-30-2007 09:17 AM

*** backs up file :) ***
*** fiddles around with it ***
*** is happy with results :):):):) ****

Emerson, thanks for the tip! :)

All times are GMT -5. The time now is 12:34 PM.