Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am running Linux Mint 13. The problem is that whenever I connect/disconnect an external monitor to my laptop it freezes. If the monitor is connected on boot it works fine. Any ideas ?

Output from inxi -SGxc 0

System:    Host: ****-VGN-NS140E Kernel: 3.2.0-23-generic x86_64 (64 bit, gcc: 4.6.3) 
           Desktop: Xfce 4.10.0 (Gtk 2.24.10) Distro: Linux Mint 13 Maya
Graphics:  Card: Intel Mobile 4 Series Chipset Integrated Graphics Controller bus-ID: 00:02.0 
           X.Org: 1.11.3 drivers: intel (unloaded: vesa,fbdev) Resolution: 1280x800@59.9hz 
           GLX Renderer: Mesa DRI Mobile Intel® GM45 Express Chipset GLX Version: 2.1 Mesa 8.0.4 Direct Rendering: Yes
share|improve this question
    
Is the monitor connected to a VGA port? –  terdon Dec 5 '12 at 14:44
    
Yes it is on VGA –  stone_cold Dec 5 '12 at 14:45
    
I had a similar problem - there is some XFCE functionality trying to configure that automagically, which can fail (badly). My workaround has been a simple script that I've used to call xrandr to set up/disable the external output, which has somehow sorted it out (not sure how, but I don't experience the freezes any more). –  peterph Dec 5 '12 at 15:14
    
Can u share that script ? –  stone_cold Dec 5 '12 at 16:43

1 Answer 1

up vote 0 down vote accepted

A script as mentioned in comment to the question:

#!/bin/bash
xrandr \
    --output LVDS-1 \
    --auto \
    --dpi 145 \
    --left-of DVI-D-1 \
    --output DVI-D-1 \
    --primary \
    --auto \
    --dpi 96
sleep 1
killall -USR1 xfce4-panel

This makes the DVI-connected device the main display device and positions the laptop screen (LVDS) to the left of DVI. Names of the devices vary - check output of xrandr -q for names on your system. After the configuration settles down, xfce4-panel is signalled to reload itself - this is mostly to ensure, that the workspace switcher updates its cached desktop sizes (without this it would only display a single screen miniatures).

To disable the monitor you need something like:

#!/bin/bash
xrandr --output DVI-D-1 --off
sleep 1
killall -USR1 xfce4-panel

You might also want to check Session and Startup entry in the XCE Settings manager fo anything that would resemble an application that would try to do this automagically and possibly remove it (I can't remember whether this was a standalone service or whether it was part of the widow manager).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.