You are not logged in.

#1 2008-08-02 12:24:01

samsari
Member
Registered: 2008-08-02
Posts: 3

Making xorg.conf apply xrandr settings at startup

Hi guys, I may have been completely blind and missed something already posted, but I have done a bit of searching and not really found anything specific to my problem.

Basically, what I have is an old laptop with a defunct screen (the backlight's gone) connected to my tv instead. The tv is an lcd tv with a maximum resolution of 1650x990 (or something like that) and is actually connected to the laptop with a VGA cable, so it's essentially an external monitor.

When xorg starts, it treats the laptop screen as the primary display and mirrors the desktop on the tv. The main problem is that in mplayer, the XV output can only be directed to one display at a time, and that is naturally defaulted to the primary display, so on the tv, I get a black box whenever I try and play a movie. Because the laptop screen is knackered, I have no need for it and so I would like some way to tell xorg to either ignore it and only use the VGA screen, or even set the tv as the primary display.

I have found the xrandr command which will turn off the laptop (LVDS) screen thereby making the tv the primary and this is perfect, but I have to manually run that command each and every time xorg starts up. What I'm looking for is something to put in xorg.conf that will do the same thing when xorg starts.

This is the command which turns off the laptop screen:

xrandr --output LVDS --off

And this is my xorg.conf

Section "ServerLayout"
    Identifier     "X.org Configured"
    Screen      0  "Screen0" 0 0
    InputDevice    "Mouse0" "CorePointer"
    InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
    RgbPath      "/usr/share/X11/rgb"
    ModulePath   "/usr/lib/xorg/modules"
    FontPath     "/usr/share/fonts/misc"
    FontPath     "/usr/share/fonts/100dpi:unscaled"
    FontPath     "/usr/share/fonts/75dpi:unscaled"
    FontPath     "/usr/share/fonts/TTF"
    FontPath     "/usr/share/fonts/Type1"
EndSection

Section "Module"
    Load  "dri"
    Load  "glx"
    Load  "record"
    Load  "extmod"
    Load  "GLcore"
#    Load  "dbe"
    Load  "xtrap"
    Load  "freetype"
EndSection

Section "InputDevice"
    Identifier  "Keyboard0"
    Driver      "kbd"
EndSection

Section "InputDevice"
    Identifier  "Mouse0"
    Driver      "mouse"
    Option        "Protocol" "auto"
    Option        "Device" "/dev/input/mice"
    Option        "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
    #DisplaySize      470   300    # mm
    Identifier   "telly"
    VendorName   "GSM"
    ModelName    "M228WA"
 ### Comment all HorizSync and VertRefresh values to use DDC:
    HorizSync    28.0 - 83.0
    VertRefresh  56.0 - 75.0
    Option        "DPMS"
    Option    "Enable" "true"
EndSection

Section "Monitor"
    Identifier    "lappy"
    Option    "DPMS"
#    Option    "Ignore" "true"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
        ### [arg]: arg optional
        #Option     "NoAccel"                # [<bool>]
        #Option     "SWcursor"               # [<bool>]
        #Option     "Dac6Bit"                # [<bool>]
        #Option     "Dac8Bit"                # [<bool>]
        #Option     "BusType"                # [<str>]
        #Option     "CPPIOMode"              # [<bool>]
        #Option     "CPusecTimeout"          # <i>
        #Option     "AGPSize"                # <i>
        #Option     "GARTSize"               # <i>
        #Option     "RingSize"               # <i>
        #Option     "BufferSize"             # <i>
        #Option     "EnableDepthMoves"       # [<bool>]
        #Option     "EnablePageFlip"         # [<bool>]
        #Option     "NoBackBuffer"           # [<bool>]
        #Option     "DMAForXv"               # [<bool>]
        #Option     "FBTexPercent"           # <i>
        #Option     "DepthBits"              # <i>
        #Option     "PCIAPERSize"            # <i>
        #Option     "AccelDFS"               # [<bool>]
        #Option     "DDCMode"                # [<bool>]
        #Option     "IgnoreEDID"             # [<bool>]
        #Option     "DisplayPriority"        # [<str>]
        #Option     "PanelSize"              # [<str>]
        #Option     "ForceMinDotClock"       # <freq>
        #Option     "ColorTiling"            # [<bool>]
        #Option     "VideoKey"               # <i>
        #Option     "RageTheatreCrystal"     # <i>
        #Option     "RageTheatreTunerPort"     # <i>
        #Option     "RageTheatreCompositePort"     # <i>
        #Option     "RageTheatreSVideoPort"     # <i>
        #Option     "TunerType"              # <i>
        #Option     "RageTheatreMicrocPath"     # <str>
        #Option     "RageTheatreMicrocType"     # <str>
        #Option     "ScalerWidth"            # <i>
        #Option     "SubPixelOrder"          # [<str>]
        #Option     "ShowCache"              # [<bool>]
        #Option     "DynamicClocks"          # [<bool>]
        #Option     "VGAAccess"              # [<bool>]
        #Option     "ReverseDDC"             # [<bool>]
        #Option     "LVDSProbePLL"           # [<bool>]
        #Option     "AccelMethod"            # <str>
        #Option     "DRI"                    # [<bool>]
        #Option     "ConnectorTable"         # <str>
        #Option     "DefaultConnectorTable"     # [<bool>]
        #Option     "DefaultTMDSPLL"         # [<bool>]
        #Option     "TVDACLoadDetect"        # [<bool>]
        #Option     "ForceTVOut"             # [<bool>]
        #Option     "TVStandard"             # <str>
        #Option     "IgnoreLidStatus"        # [<bool>]
    Identifier  "Card0"
    Driver      "radeon"
    VendorName  "ATI Technologies Inc"
    BoardName   "Radeon Mobility M6 LY"
    BusID       "PCI:1:0:0"
        Option          "AGPMode" "4"
        Option          "AGPSize" "16" # default: 8
        Option          "RingSize" "4"
        Option          "BufferSize" "2"
        Option          "EnablePageFlip" "true"
        Option          "RenderAccel" "true"
        Option          "AccelMethod" "XAA" # or XAA, EXA
        Option          "DDCMode"
        Option          "SubPixelOrder" "NONE"
        Option          "ColorTiling" "true"
        Option          "DynamicClocks" "true"
        Option          "bioshotkeys"   "True"
        Option      "DRI"     "true"
    Option     "VideoOverlay"    "on"
#    Option    "MonitorLayout"    "VGA"
        Option          "monitor-VGA" "telly"
        Option          "monitor-LVDS" "lappy"

EndSection

Section "Screen"
    Identifier "Screen0"
    Device     "Card0"
    Monitor    "telly"
    DefaultDepth    24
#    SubSection "Display"
#        Viewport   0 0
#        Depth     1
#    EndSubSection
#    SubSection "Display"
#        Viewport   0 0
#        Depth     4
#    EndSubSection
#    SubSection "Display"
#        Viewport   0 0
#        Depth     8
#    EndSubSection
#    SubSection "Display"
#        Viewport   0 0
#        Depth     15
#    EndSubSection
#    SubSection "Display"
#        Viewport   0 0
#        Depth     16
#    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     24
    EndSubSection
EndSection

Section "DRI"
 Group        "video"
 Mode         0666
EndSection

I know it can be done because I have moved to Arch from Ubuntu this week and it was working perfectly before. Sadly, there is always one thing you forget when backing stuff up, and this time it was the xorg.conf file I forgot about. Typical, really smile

Offline

#2 2008-08-03 05:17:05

pauldonnelly
Member
Registered: 2006-06-19
Posts: 776

Re: Making xorg.conf apply xrandr settings at startup

Could you unplug the built-in screen? Maybe X would detect its absence. If the screen's broken, you could just take it off entirely.

I think you'll need to see the man page for your driver to find out how to set which screen to use.

Couldn't you just put

xrandr --output LVDS --off

in your .xinitrc?

Offline

#3 2008-08-03 12:25:45

tim
Member
From: Sweden
Registered: 2006-10-29
Posts: 98

Re: Making xorg.conf apply xrandr settings at startup

what happens if you comment out the 'lappy' monitor section?

Offline

#4 2008-08-03 20:24:38

samsari
Member
Registered: 2008-08-02
Posts: 3

Re: Making xorg.conf apply xrandr settings at startup

Hey, guys. Thanks for replying.

@pauldonnelly
I haven't tried unplugging the laptop built-in screen yet. I'd like to think there was a less drastic solution - it did, after all, work when I used Ubuntu before. I tried putting that in the .xinitrc, but it didn't make any difference. Perhaps I got my commands wrong?

@tim
It doesn't make any difference, the built-in screen is still detected and used for preference.

I assumed xrandr was simply a way of setting the xorg server "on the fly" and that I would be able to apply the same settings on as it starts up. Perhaps it's just not possible and my Ubuntu install was doing something else that I'm not accounting for?

Offline

#5 2008-08-03 20:41:53

thengineer
Member
From: Austria
Registered: 2008-08-03
Posts: 5
Website

Re: Making xorg.conf apply xrandr settings at startup

@samsari: i've put my xrandr command in the .xinitrc too (for dual head support) too, and it works here.
maybe you should make sure its being executed before your desktop environment.

Offline

#6 2008-08-03 23:13:36

pauldonnelly
Member
Registered: 2006-06-19
Posts: 776

Re: Making xorg.conf apply xrandr settings at startup

samsari wrote:

@pauldonnelly
I haven't tried unplugging the laptop built-in screen yet. I'd like to think there was a less drastic solution - it did, after all, work when I used Ubuntu before. I tried putting that in the .xinitrc, but it didn't make any difference. Perhaps I got my commands wrong?

Meh, if my screen was broken I'd rather take it off entirely than have it wobbling around while I'm trying to use the computer. Doesn't seem especially drastic to me.

But as for commands in .xinitrc, perhaps it isn't actually being run because of the way you start X (whatever that might be). To make your change in xorg.conf, I'd think it would be something driver specific, like

Option        "MonitorLayout" "CRT,LFP"

for my Intel card.

Last edited by pauldonnelly (2008-08-03 23:14:06)

Offline

#7 2008-08-03 23:36:27

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Making xorg.conf apply xrandr settings at startup

You might have better response if you put the xrandr commands in /etc/rc.local.......


My ailment? Lackatesla!
Tesla fails smog test..no gas!
Favorite song...Tesla On My Mind....

Offline

#8 2008-08-04 02:11:00

tim
Member
From: Sweden
Registered: 2006-10-29
Posts: 98

Re: Making xorg.conf apply xrandr settings at startup

What about just unplugging the cable from the main board to the screen? I've taken apart a few laptops in my time and they were all very modular and in my experience almost unbreakable. I think that would surely eliminate the problem. If you want to do this and need/want some help then tell me what your laptop is and I think I could find some instructions specific to your particular model.

On the same track, have you tried sourcing a backlight? I mean if the screen is nackered then playing with it to try and replace the backlight wont make it any worse. I think you could probably find one for a few dollars and I bet it wouldn't be too hard big_smile

Edit: Not sure where you live but here is a store that sells backlights in oz:

http://www.lcdparts.net/CCFL.aspx

$15 is the most expensive one they have.

Last edited by tim (2008-08-04 02:18:54)

Offline

#9 2009-10-17 09:42:03

offline15
Member
Registered: 2009-10-17
Posts: 5

Re: Making xorg.conf apply xrandr settings at startup

I have almost the same problem. Did you find a solution? What is annoying me is that on X startup, both monitors works, and i want only one monitor. Should i describe second monitor in xorg.conf and set option  "Enable" "false"?

Offline

#10 2009-11-30 17:06:35

rwd
Member
Registered: 2009-02-08
Posts: 636

Re: Making xorg.conf apply xrandr settings at startup

Configuring x via xorg.conf seems to be depreciated in favour of autodetection and dynamically through xrandr, either directly or with some graphical front-end for it. xrandr only has effect *after* x has started, So putting it in /etc/rc.local ~/.xinitrc won't work.

This works for me with Xfce: 

in ~/.config/autostart/turn_off_notebook_monitor.desktop :

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=turn_off_notebook_monitor
Comment=turn off notebook monitor
Exec=xrandr --output LVDS --off
StartupNotify=false
Terminal=false
Hidden=false

Last edited by rwd (2009-11-30 18:18:29)

Offline

#11 2009-12-01 14:13:23

big_gie
Member
Registered: 2005-01-19
Posts: 637

Re: Making xorg.conf apply xrandr settings at startup

HAve you tried looking at HAL's config file instead of xorg.conf? I know I have some options there for my synaptics touchpad...

Offline

#12 2014-01-13 12:27:51

wootsgoinon
Member
Registered: 2013-10-30
Posts: 32

Re: Making xorg.conf apply xrandr settings at startup

i know it's kinda old, but in case someone is still wondering here's a simple solution (adjusted for console tdm+awesome)

/bin/lvds1

#!/usr/bin/env bash

STATE=$1
if [ $STATE == "off" ]
then
        xrandr --output LVDS1 --off
elif [ $STATE == "on" ]
then
        xrandr --output LVDS1 --auto
else
        echo "on/off"
fi

note that you should replace LVDS1 with whatever your device name is. hit

xrandr -q

to make sure.

~/.xinitrc

lvds1 off
exec tdm --xstart

Last edited by wootsgoinon (2014-01-13 13:38:45)

Offline

#13 2014-01-13 16:33:58

Inxsible
Administrator
From: Chicago burbs
Registered: 2008-06-09
Posts: 9,020

Re: Making xorg.conf apply xrandr settings at startup

wootsgoinon, this thread is really old. The default is no longer having a xorg.conf file.

Thanks for the solution, but I am going to close this thread to avoid further necrobumping...

Offline

Board footer

Powered by FluxBB