Skip to content

Allow disabling internal notebook monitor when external is connected #2696

@thiagoufg

Description

@thiagoufg

Many people need this, and deepin doesn't allow it in an easy way (graphically).

Currently, the internal laptop monitor is always ON, even if there is an external monitor connected and the notebook lid is closed. As a result, the login screen, the dock (launcher), and many other windows are hidden from the users's main monitor (the external), in case he chooses to only use the external.

There are xrandr commands out there, like the one I posted at the end of this issue, but scripts like these are difficult to set up and, in my case, after a reboot, even though the internal notebook monitor was OFF and the external was ON, I had problems with resolution, which were also fixed with some more scripts, and then, I had issues with the task bar (dock, launcher) position, which apparently was considering the resolution of the internal monitor rather than the external.

So, a lot of issues!

By the way, my computer is a SONY VAIO VPCEB and my graphics card is ATI Mobility Radeon HD 5470.

Have to create a script in /etc/X11/Xsession.d/ called "45custom_xrandr-settings"

Contents are:

Code:
EXTERNAL_OUTPUT="VGA"
INTERNAL_OUTPUT="LVDS"

xrandr |grep $EXTERNAL_OUTPUT | grep " connected "
if [ $? -eq 0 ]; then
xrandr --output $INTERNAL_OUTPUT --off --output $EXTERNAL_OUTPUT --auto 
else
xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --off
fi
At startup this checks if external display is connected.
If it is connected then the laptop monitor turns OFF and external monitor turns ON.
If the external display is NOT connected then only internal monitor works.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions