Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-25-2007, 02:29 PM   #1
LQ Newbie
Registered: May 2007
Location: Iowa, USA
Distribution: grml 0.9
Posts: 8

Rep: Reputation: 0
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.

Last edited by Castanea_d.; 05-25-2007 at 02:40 PM.
Old 05-25-2007, 03:00 PM   #2
LQ Guru
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 6,311

Rep: Reputation: Disabled
1) Yo really can't beat the backup method
2) A good way to change X server parameters is editing /etc/X11/xorg.conf.
Old 05-30-2007, 08:17 AM   #3
LQ Newbie
Registered: May 2007
Location: Iowa, USA
Distribution: grml 0.9
Posts: 8

Original Poster
Rep: Reputation: 0
*** backs up file ***
*** fiddles around with it ***
*** is happy with results ****

Emerson, thanks for the tip!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Init.d services take a long time loading after fixing a corrupted hosts file ishaypeled Fedora 2 01-29-2007 07:20 AM
.xinitrc - root is the only one with this file N_A_J_M Linux - General 7 09-30-2004 06:43 PM
Corrupted my ReiserFS by fixing it...HELP! pAn1k Linux - Software 7 09-13-2004 12:40 AM
where is .xinitrc file in suse? ksgill Linux - Newbie 1 07-15-2004 10:38 PM
can't find the .xinitrc file deezay Linux - General 2 04-10-2002 08:17 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:22 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration