I successfully connected an external monitor to my laptop, using HDMI cable (also keyboard and mouse)
Now, I would like to close the laptop's lid.
Problem is: it shuts down both laptop's screen, AND the external monitor.
How to close the lid and keep the external monitor on?
I was not able to find an option in control panel.
This works under Windows, if that matters.
Fatdog64-700.
HP 15t Laptop
Thank you.
Fatdog64-700: How to use external monitor with lid closed?
The /etc/acpi/actions/suspend.sh script can be modified so that is automatically detects if the second monitor is connected and prevents the suspend operation.
All you need to do is add the following two lines to the script:
WORKS WITH: this has been tested with Puppy Slacko 6.3.0 ... I haven't tested it with other distributions.
NOTE: the lines should be placed in the middle of the script, before the suspend process begins (i.s. after the part detecting if an USB media is mounted).
Here's the complete suspend.sh file from my laptop:
All you need to do is add the following two lines to the script:
Code: Select all
# do not suspend if external monitor is connected
xrandr | grep "VGA1 connected" && exit
NOTE: the lines should be placed in the middle of the script, before the suspend process begins (i.s. after the part detecting if an USB media is mounted).
Here's the complete suspend.sh file from my laptop:
Code: Select all
#!/bin/sh
# suspend.sh 28sep09 by shinobar
# 12feb10 pass poweroff
# 23apr12 fix was not suspend from acpi_poweroff.sh
#20140526 shinobar: avoid multiple run
#avoid multiple run
LOCKFILE=/tmp/acpi_suspend-flg
if [ -f "$LOCKFILE" ]; then
PID=$(cat "$LOCKFILE")
ps| grep "^[ ]*$PID " && exit
fi
echo -n $$ > "$LOCKFILE"
sync
[ "$(cat "$LOCKFILE")" = $$ ] || exit 0
# do not suspend at shutdown proccess
#111129 added suspend to acpi_poweroff.sh
PS=$(ps)
[ ! -f /tmp/suspend ] && echo "$PS"| grep -qE 'sh[ ].*poweroff' && rm -f "$LOCKFILE" && exit 0
rm -f /tmp/suspend
# do not suspend if usb media mounted
USBS=$(probedisk2|grep '|usb' | cut -d'|' -f1 )
for USB in $USBS
do
mount | grep -q "^$USB" && rm -f "$LOCKFILE" && exit 0
done
# do not suspend if external monitor is connected
xrandr | grep "VGA1 connected" && exit
# process before suspend
# sync for non-usb drives
sync
rmmod ehci_hcd
#suspend
echo -n mem > /sys/power/state
# process at recovery from suspend
#restartwm
modprobe ehci_hcd
#/etc/rc.d/rc.network restart
rm -f "$LOCKFILE"