LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 09-06-2010, 05:12 PM   #1
saavedra29
Member
 
Registered: Aug 2010
Location: Greece
Distribution: slackware
Posts: 42

Rep: Reputation: 3
slackware, how to configure external monitor in laptop?


Hello everyone!
I have slackware 13.1 installed on my laptop and use kde.I just bought a new external monitor 1680 X 1050. The laptop's monitor is 1280 X 800. From KDE i configured laptop's screen to be inactive and the external monitor at resolution 1680 X 1050.
When i boot and enter KDE both monitors are activated, ican't understand their resolution. Then, just when i enter system configuration-monitor-monitor configuration the laptop's monitor automaticly turns off. Then i configure the external to 1680 X 1050 resolution. This happens every time i have to enter slackware.
Can you help me setup my xorg.conf file. You can see it below:
Code:
Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen      0  "Screen0" 0 0
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
        ModulePath   "/usr/lib/xorg/modules"
        FontPath     "/usr/share/fonts/local"
        FontPath     "/usr/share/fonts/TTF"
        FontPath     "/usr/share/fonts/OTF"
        FontPath     "/usr/share/fonts/Type1"
        FontPath     "/usr/share/fonts/misc"
        FontPath     "/usr/share/fonts/CID"
        FontPath     "/usr/share/fonts/75dpi/:unscaled"
        FontPath     "/usr/share/fonts/100dpi/:unscaled"
        FontPath     "/usr/share/fonts/75dpi"
        FontPath     "/usr/share/fonts/100dpi"
        FontPath     "/usr/share/fonts/cyrillic"
EndSection

Section "Module"
        Load  "glx"
        Load  "dri2"
        Load  "dri"
        Load  "extmod"
        Load  "dbe"
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"                                                                                    
        Identifier   "Monitor0"                                                                      
        VendorName   "Monitor Vendor"                                                                
        ModelName    "Monitor Model"                                                                 
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     "ColorKey"                  # <i>
        #Option     "CacheLines"                # <i>
        #Option     "Dac6Bit"                   # [<bool>]
        #Option     "DRI"                       # [<bool>]
        #Option     "NoDDC"                     # [<bool>]
        #Option     "ShowCache"                 # [<bool>]
        #Option     "XvMCSurfaces"              # <i>
        #Option     "PageFlip"                  # [<bool>]
        Identifier  "Card0"
        Driver      "intel"
        VendorName  "Unknown Vendor"
        BoardName   "Unknown Board"
        BusID       "PCI:0:2:0"
EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        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
also my graphic's card is
Code:
00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controlle
r (rev 03) (prog-if 00 [VGA controller])
and xrandr -q command says:
Code:
slaris@aris29:~$ xrandr -q
Screen 0: minimum 320 x 200, current 1680 x 1050, maximum 8192 x 8192
VGA1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 474mm x 296mm
   1680x1050      59.9*+   60.0  
   1280x1024      75.0     60.0  
   1440x900       75.0     59.9  
   1280x960       60.0  
   1152x864       75.0  
   1024x768       75.1     60.0  
   832x624        74.6  
   800x600        75.0     60.3     56.2  
   640x480        75.0     60.0  
   720x400        70.1  
LVDS1 connected (normal left inverted right x axis y axis)
   1280x800       60.0 +
   1024x768       60.0  
   800x600        60.3     56.2  
   640x480        59.9  
TV1 disconnected (normal left inverted right x axis y axis)
Do you have any idea how to fix it?

Last edited by saavedra29; 09-06-2010 at 05:47 PM.
 
Old 09-06-2010, 08:07 PM   #2
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 3,283

Rep: Reputation: 802Reputation: 802Reputation: 802Reputation: 802Reputation: 802Reputation: 802Reputation: 802
Have you tried not having an xorg.conf file? i.e. Just rename your /etc/X11/xorg.conf file to something like /etc/X11/xorg.conf.old and restart X. The X autodetection should have no problem with your setup.

PS Welcome to LQ!

Last edited by allend; 09-06-2010 at 08:08 PM.
 
Old 09-07-2010, 01:47 AM   #3
D1ver
Member
 
Registered: Jan 2010
Distribution: Slackware 13.37
Posts: 527
Blog Entries: 3

Rep: Reputation: 126Reputation: 126
If you have KDE installed, the 'system settings->display settings" GUI works flawlessly in my experiences. I'm often jumping between different screens on my netbook and it hasn't missed a beat.
 
Old 09-07-2010, 07:56 AM   #4
saavedra29
Member
 
Registered: Aug 2010
Location: Greece
Distribution: slackware
Posts: 42

Original Poster
Rep: Reputation: 3
i deleted the xorg.conf file (first i got a backup) and rebooted. It created almost the same file just adding a line (i can't remember it but nothing changed in the settings). Then i restored the old xorg.conf.
Allend i didn't try to rename the xorg.conf file but sisce i did what i mentioned above i guess it's the same thing. If i am wrong let me know and i will try it.
Diver i have KDE and when i change the settings every time i log in everything works ok. But the point is, if possible, not to change these settings every time i log in. I just thought if xorg.conf could do it automaticelly..
 
Old 09-07-2010, 12:24 PM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,514
Blog Entries: 27

Rep: Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174
Here's the script I have configured on Slackware 13.1 to run on pressing Fn+F4, the hotkey to switch between internal and external screens on a Samsung N150 netbook. Some of it is hardware specific (VGA1 and LVDS1) and you may or may not want to use yad (or zenity ...) to display a message in the graphical desktop environment but hopefully it will give some useful clues. The first version was more complex but xrandr's --auto option did all I wanted and simplified the code. The shell setup commands are probably superfluous.
Code:
#! /bin/bash

# Set up shell
export PATH=/usr/local/bin:/usr/bin:/bin
set -o nounset
shopt -s extglob
unalias -a

# Get status
xrandr_q_out=$( xrandr -q )

# Check external screen connected
if [[ ! $xrandr_q_out =~ 'VGA1 connected' ]]; then
    /usr/bin/yad --button=gtk-quit --image=/usr/share/icons/Tango/22x22/status/error.png \
        --on-top --sticky --title=" ${0##*/} " \
        --text 'Error: external screen not connected' \
        --window-icon /usr/share/icons/Tango/22x22/status/error.png
    exit 1
fi

# Determine which screen to de/activate
internal_active=
external_active=
while read line
do
    [[ $line =~ ^VGA1.*mm$ ]] && external_active=true
    [[ $line =~ ^LVDS1.*mm$ ]] && internal_active=true
done <<< "$xrandr_q_out"
# If both active switch to external to suit most common usage pattern.
if [[ $internal_active ]]; then
    new_screen=VGA1
    old_screen=LVDS1
else
    new_screen=LVDS1
    old_screen=VGA1
fi

# Switch screens
xrandr --output $new_screen --auto && xrandr --output $old_screen --off

exit
 
Old 09-07-2010, 12:45 PM   #6
igadoter
Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: slack 12.2, debian-Trinity , openbsd
Posts: 723

Rep: Reputation: 56
Hi,
the strange for me is that xrandr cannot determines default settings for your LVDS (laptop) display - they are matched by star '*'. Try to run any other desktop or window manger and setup layout with xrandr. Due to your information (I guess) the system starts in clone mode (both displays have the same contents) but this impossible as maximall resolution of your laptop display is too small. This (I guess) causes your laptop display turns off. Maybe this will help: 1) turn off your VGA display, 2) run X server, 3) run xrandr and blindly (without turning on) setup layout of your displays - resolutions, refresh rates, relative positions, 4) turn on VGA display. Finally check out man for intel card driver. Greetings.
 
Old 09-07-2010, 01:44 PM   #7
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,240

Rep: Reputation: 187Reputation: 187
On my ThinkPads from T series I use the following script to switch between the screens:

Code:
#!/bin/bash
 
# External output may be "VGA" or "VGA-0" or "DVI-0" or "TMDS-1"
EXTERNAL_OUTPUT="VGA-0"
INTERNAL_OUTPUT="LVDS"
EXTERNAL_LOCATION="left"
 
# Figure out which user and X11 display to work on
# TODO there has to be a better way to do this?
X_USER=$(w -h -s | grep ":[0-9]\W" | head -1 | awk '{print $1}')
export DISPLAY=$(w -h -s | grep ":[0-9]\W" | head -1 | awk '{print $3}')

echo $X_USER $DISPLAY
 
# Switch to X user if necessary
if [ "$X_USER" != "$USER" ]; then
       SU="su $X_USER -c"
else
       SU="sh -c"
fi
 
case "$EXTERNAL_LOCATION" in
       left|LEFT)
               EXTERNAL_LOCATION="--left-of $INTERNAL_OUTPUT"
               ;;
       right|RIGHT)
               EXTERNAL_LOCATION="--right-of $INTERNAL_OUTPUT"
               ;;
       top|TOP|above|ABOVE)
               EXTERNAL_LOCATION="--above $INTERNAL_OUTPUT"
               ;;
       bottom|BOTTOM|below|BELOW)
               EXTERNAL_LOCATION="--below $INTERNAL_OUTPUT"
               ;;
       *)
               EXTERNAL_LOCATION="--left-of $INTERNAL_OUTPUT"
               ;;
esac
 
# Figure out current state
# INTERNAL_STATE=$($SU xrandr | grep ^$INTERNAL_OUTPUT | grep " con" | sed "s/.*connected//" | sed "s/ //" | sed "s/ .*//g")
# EXTERNAL_STATE=$($SU xrandr | grep ^$EXTERNAL_OUTPUT | grep " con" | sed "s/.*connected//" | sed "s/ //" | sed "s/ .*//g")

# I recommend to replace these prior two statements, since otherwise with  xrandr 1.2 it produces wrong results:
# a textportion "(normal" otherwise still remains when a screen is connected, but switched off (by e.g. toggling!)
# (comment out the prior two lines, and uncomment the following two lines:)
INTERNAL_STATE=$($SU xrandr | grep ^$INTERNAL_OUTPUT | grep " con" | sed "s/.*connected//" | sed "s/ //" | sed "s/ .*//g"| sed "s/(normal//g" )
EXTERNAL_STATE=$($SU xrandr | grep ^$EXTERNAL_OUTPUT | grep " con" | sed "s/.*connected//" | sed "s/ //" | sed "s/ .*//g"| sed "s/(normal//g" )
 
 
if [ -z "$INTERNAL_STATE" ]; then
       STATE="external"
elif [ -z "$EXTERNAL_STATE" ]; then
       STATE="internal"
else
       INTERNAL_STATE=$(echo $INTERNAL_STATE | sed "s/[0-9]*x[0-9]*//")
       EXTERNAL_STATE=$(echo $EXTERNAL_STATE | sed "s/[0-9]*x[0-9]*//")
       if [ "$INTERNAL_STATE" = "$EXTERNAL_STATE" ]; then
               STATE="mirror"
       else
               STATE="both"
       fi
fi
 
function screen_external(){
# recommend exchange the order, since otherwise doesn't work
# with my ati adapter (please uncomment if needed, and
#comment out the other two):
       $SU "DISPLAY=$DISPLAY xrandr --output $EXTERNAL_OUTPUT --auto"
       $SU "DISPLAY=$DISPLAY xrandr --output $INTERNAL_OUTPUT --off"
#       $SU "DISPLAY=$DISPLAY xrandr --output $INTERNAL_OUTPUT --off"
#       $SU "DISPLAY=$DISPLAY xrandr --output $EXTERNAL_OUTPUT --auto"
echo "*** ext"
}
 
function screen_internal(){
       $SU "DISPLAY=$DISPLAY xrandr --output $EXTERNAL_OUTPUT --off"
       $SU "DISPLAY=$DISPLAY xrandr --output $INTERNAL_OUTPUT --auto"
echo "*** int"
}
 
function screen_mirror(){
       $SU "DISPLAY=$DISPLAY xrandr --output $INTERNAL_OUTPUT --auto"
       $SU "DISPLAY=$DISPLAY xrandr --output $EXTERNAL_OUTPUT --auto --same-as $INTERNAL_OUTPUT"
echo "*** mir"
}
 
function screen_both(){
       $SU "DISPLAY=$DISPLAY xrandr --output $INTERNAL_OUTPUT --auto"
       $SU "DISPLAY=$DISPLAY xrandr --output $EXTERNAL_OUTPUT --auto $EXTERNAL_LOCATION"
echo "*** bot"
}
 
function screen_toggle(){
       case "$STATE" in
               internal)
                       screen_mirror
                       ;;
               mirror)
                       screen_external
                       ;;
               external)
                       screen_both
                       ;;
               both)
                       screen_internal
                       ;;
               *)
                       screen_internal
                       ;;
       esac
}
 
# What should we do?
DO="$1"
if [ -z "$DO" ]; then
       if [ $(basename $0) = "thinkpad-fn-f7" ]; then
               DO="toggle"
       fi
fi
 
case "$DO" in
       toggle)
               screen_toggle
               ;;
       internal)
               screen_internal
               ;;
       external)
               screen_external
               ;;
       mirror)
               screen_mirror
               ;;
       both)
               screen_both
               ;;
       status)
               echo "Current Fn-F7 state is: $STATE"
               echo
               echo "Attached monitors:"
               $SU xrandr | grep "\Wconnected" | sed "s/^/ /"
               ;;
       *)
               echo "usage: $0 <command>" >&2
               echo >&2
               echo "  commands:" >&2
               echo "          status" >&2
               echo "          internal" >&2
               echo "          external" >&2
               echo "          mirror" >&2
               echo "          both" >&2
               echo "          toggle" >&2
               echo >&2
               ;;
esac
With the help of that script I tried to watch movies on external TV set. Unfortunately Xine and MPlayer can't send a valid image to the TV screen -- or at least I was unable to achieve it using D-Sub socket for video signal and headphones socket for audio signal. Fortunately VLC player available on Alien's homepage works well.
 
Old 09-07-2010, 04:10 PM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,514
Blog Entries: 27

Rep: Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174
The script does work. At first both screens have the built in display resolution. After pressing the hot key that runs the script the built in display goes blank then the external is changed to its native resolution. This is probably hardware dependent but has worked with three different external displays.

EDIT:

The above was from memory and is not quite correct; observation shows that the external screen is blank until the script runs when it first displays the built in screen, tiled and then changes to native resolution. The desktop is Xfce.

Last edited by catkin; 09-08-2010 at 12:23 AM.
 
Old 09-08-2010, 05:35 AM   #9
saavedra29
Member
 
Registered: Aug 2010
Location: Greece
Distribution: slackware
Posts: 42

Original Poster
Rep: Reputation: 3
Thank you very much for the replies!
However i didn't think i would get so confused with configuring the external screen.From all the searching i have come to 2 conclusions. I have either to get the external monitor to the top of the screen and the laptop's to the bottom and configure their resolutions separately or just use a script as you mention above and select, before running X, which screen will i use.
I like more the script solution but..do i have to configure the xorg.cong first to give the resolutions? If yes i don't know how to do this. I started reading the man xorg.conf but quitted as i didn't understand many things. I don't know what to replace and where. Can you help me at this?
And the other is that when i make the script and configure it with my needs i have to place it in a file so that it runs automaticly before running X. Do you know which is this file?
 
Old 09-08-2010, 06:32 AM   #10
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,514
Blog Entries: 27

Rep: Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174
I do not have a /etc/X11/xorg.conf file.

You could run a script from the KDE session autostart facility (that is generic terminology -- I do not know what it is called in KDE-speak)
 
Old 09-08-2010, 07:21 AM   #11
saavedra29
Member
 
Registered: Aug 2010
Location: Greece
Distribution: slackware
Posts: 42

Original Poster
Rep: Reputation: 3
I made this script:
Code:
xrandr | grep VGA | grep " connected "

if [ $? -eq 0 ]; then
        xrandr --output LVDS --off --output VGA --mode 1440x900
fi
I putted it in /etc/X11/xinit/xinitrc but didn't work.
The same when i putted this in /etc/X11/xinit/xinitrc.kde
Then i made an *.sh file with it, gave permissions and pasted it in /home/slaris/.kde/Autostart.It didn't work too.
I am sure this will work, but i need to put it in the right file..
can you suggest any other files to try it?

(I boot with console and start kde with startX)

Last edited by saavedra29; 09-08-2010 at 07:22 AM.
 
Old 09-08-2010, 07:27 AM   #12
igadoter
Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: slack 12.2, debian-Trinity , openbsd
Posts: 723

Rep: Reputation: 56
@saavedra29
I don't understand. Do you want to disable the display of your notebook?
 
Old 09-08-2010, 07:31 AM   #13
saavedra29
Member
 
Registered: Aug 2010
Location: Greece
Distribution: slackware
Posts: 42

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by igadoter View Post
@saavedra29
I don't understand. Do you want to disable the display of your notebook?
Yes. Disable it ( only if VGA is active ) and enable VGA ( the external ).
 
Old 09-08-2010, 08:04 AM   #14
igadoter
Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: slack 12.2, debian-Trinity , openbsd
Posts: 723

Rep: Reputation: 56
Why don't you try a virtual desktop? Your monitors should work well with xinerama mode for 1280 height, LVDS 1280x800, VGA 1280x1024. What is a true size of VGA display? I mean in inches? Is it a large display?
 
Old 09-08-2010, 08:24 AM   #15
saavedra29
Member
 
Registered: Aug 2010
Location: Greece
Distribution: slackware
Posts: 42

Original Poster
Rep: Reputation: 3
The vga is 22' inches with maximum resolution 1680x1050, but i preffer 1440x900.
Xinerama, i think is a program that i have to download and install. But since i am new in slackware it will be a lot of trouble for me. Believe me.Also i wouldn't like to use the laptop's monitor, i don't really need 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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
external monitor on laptop stu_mueller Slackware 13 04-29-2008 03:00 PM
how use external monitor with laptop? lugoteehalt Linux - Laptop and Netbook 5 02-11-2006 09:35 AM
External Monitor detection from laptop vern518 Linux - Newbie 4 01-19-2005 02:04 PM
Linux Laptop External Monitor Help Please!! Law1213 Mandriva 12 07-15-2004 03:52 PM
external monitor on a laptop bobterri Linux - Hardware 2 01-14-2003 07:30 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration