LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 09-06-2013, 02:42 PM   #1
stozi
Member
 
Registered: Mar 2010
Distribution: Void Linux
Posts: 37

Rep: Reputation: 0
how to put these 2 simple commands into xorg.conf?


Hi I can see how to do one or the other, but I don't quite get how to set up xorg.conf with both these settings:

xrandr --output LVDS-0 --off

xrandr --output VGA-0 --mode 1280x1024

Thanks for any help!
 
Old 09-06-2013, 03:42 PM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Linux From Scratch, Slackware64, Partedmagic
Posts: 2,252

Rep: Reputation: 559Reputation: 559Reputation: 559Reputation: 559Reputation: 559Reputation: 559
xrandr is an X command ie it can only be run from an X server you can't put it in the xorg.conf.

A bit more information on what you want to accomplish would help also your xorg.conf, in the meantime have a look at the man page for xorg.conf.
 
Old 09-06-2013, 04:41 PM   #3
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,158
Blog Entries: 10

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
/etc/rc.local depending on Distro...
 
Old 09-06-2013, 07:22 PM   #4
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Linux From Scratch, Slackware64, Partedmagic
Posts: 2,252

Rep: Reputation: 559Reputation: 559Reputation: 559Reputation: 559Reputation: 559Reputation: 559
Quote:
Originally Posted by Habitual View Post
/etc/rc.local depending on Distro...
I don't think that would work a xrandr has to be run from within X you cant for instance start X switch to a console and then run xrandr.

I'm pretty sure that every thing that you can do with xrandr you can do by correctly configuring xorg after all xrandr is just the X interface to Xorgs randr module
 
Old 09-07-2013, 02:24 AM   #5
stozi
Member
 
Registered: Mar 2010
Distribution: Void Linux
Posts: 37

Original Poster
Rep: Reputation: 0
Another way of putting it is that I want to use xorg.conf instead of running these commands every time I boot.

I want LVDS-0 off and VGA-0 res 1280x1024

xorg.conf is really complicated, I don't have one right now, but apparently I need it for these settings. I'm not sure what all I must put in there just to get these two simple settings.

Thanks again
 
Old 09-07-2013, 03:54 AM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,599

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Try putting the following in /etc/X11/xorg.conf.d under the name "02-screen.conf"
Code:
Section "Default Screen Section"
    Identifier	"Screen0"
    Device	"Card0"
    Monitor	"Monitor0"
    DefaultDepth	24
    SubSection	"Display"
	Viewport	0 0
	Depth		24
	Modes		"1280x1024"
    EndSubSection
EndSection
I hope the Identifier, Device, and Monitor lines have the default names used as I don't know for sure what they should be. The names I give above are from a generic run of "Xorg -configure" which will generate a mostly valid configuration based on the hardware installed. I say mostly, because it cannot tell at configure time whether the monitors attached are actually valid - so if a videocard supports multiple (my card has three, but only two have plugs, and of those two, only one is used), it will define multiple, which will cause errors when it tries to actually use that configuration.

The Subsection "Display" specify the number of bits to use and the display specifies the resolution (the Modes line). There can be multiple modes, which should allow you to cycle through the list (ctrl-alt-+ or ctrl-alt-- (the +/- last character is from the keypad)). You can find valid modes to list in your /var/log/Xorg.0.log files identified by lines with "Modeline" followed by the mode name, and a list of timing numbers associated with that specific mode.

And if all else fails, delete the file (sorry about that).

Oh - forgot. You will have to log out before it will take effect. Just be sure you can login through a console virtual terminal (ctrl-alt-F2/3/...) to delete the file. If it doesn't work, the X display will not start...

Last edited by jpollard; 09-07-2013 at 03:57 AM.
 
Old 09-07-2013, 04:08 AM   #7
stozi
Member
 
Registered: Mar 2010
Distribution: Void Linux
Posts: 37

Original Poster
Rep: Reputation: 0
Hi thanks very much, I fooled around a bit and got the desired effect with /etc/X11/xorg.conf like so:
Code:
Section "Device"
        Identifier	"lappy"
        Driver		"modesetting"
        Option		"monitor-VGA" "VGA-0"
        Option		"monitor-LVDS" "LVDS-0"
EndSection

Section "Monitor"
        Identifier	"VGA-0"
        Option		"PreferredMode" "1280x1024"
EndSection

Section "Monitor"
        Identifier	"LVDS-0"
        Option		"Disable" "true"
Endsection
Is there anything wrong with this? is /etc/X11/xorg.conf.d/02-screen.conf more correct?
 
Old 09-07-2013, 05:52 AM   #8
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,599

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Nope. The only advantage the /etc/X11 files have is a small amount of flexibility - the leading number on the name sets the order they are included. It just allows sections to be replaced/added with just a file removal/copy

What you have is fine.
 
Old 09-07-2013, 08:38 PM   #9
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,158
Blog Entries: 10

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
Quote:
Originally Posted by Keith Hedger View Post
I don't think that would work a xrandr has to be run from within X you cant for instance start X switch to a console and then run xrandr.

I'm pretty sure that every thing that you can do with xrandr you can do by correctly configuring xorg after all xrandr is just the X interface to Xorgs randr module
You are quite correct as /etc/rc.local would process before the DM has loaded.
 
Old 09-08-2013, 09:09 AM   #10
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,599

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
Originally Posted by Habitual View Post
You are quite correct as /etc/rc.local would process before the DM has loaded.
The real problem is that the X server gets reset/restarted on every login/logout.

Putting it in rc.local does nothing (except generate errors) as the X server is not necessarily running, and even if running, will not have access to it.
 
  


Reply


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
Missing xorg.conf file in /etc/X11/xorg.conf Altiris Linux - Newbie 2 08-24-2013 12:46 AM
X starts without xorg.conf, however with aticonfig, resultant xorg.conf hangs linuxbird Linux - Desktop 3 08-23-2012 06:28 AM
My xorg.conf is replaced with a default xorg.conf after reboot rrrssssss Linux - Hardware 9 04-11-2010 05:45 PM
nvidia xorg.conf OR X windows xorg.conf? machines Slackware 3 04-06-2008 03:10 PM
[SOLVED] how much ram to put in xorg.conf for nvidia nforce 430 hoodooman Linux - Hardware 3 12-07-2007 09:38 AM


All times are GMT -5. The time now is 05:54 AM.

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