Fatdog64-700: How to use external monitor with lid closed?

Using applications, configuring, problems
Post Reply
Message
Author
dbabits
Posts: 42
Joined: Sat 17 Nov 2007, 01:50

Fatdog64-700: How to use external monitor with lid closed?

#1 Post by dbabits »

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.
User avatar
Ted Dog
Posts: 3965
Joined: Wed 14 Sep 2005, 02:35
Location: Heart of Texas

#2 Post by Ted Dog »

disable suspend.
dbabits
Posts: 42
Joined: Sat 17 Nov 2007, 01:50

#3 Post by dbabits »

how do I do that? (no option in Bios)
User avatar
Ted Dog
Posts: 3965
Joined: Wed 14 Sep 2005, 02:35
Location: Heart of Texas

#4 Post by Ted Dog »

Change permissions of '/etc/acpi/actions/suspend.sh'

remove execution bit


select file carefully do not double click right mouse button to drop down optons select permissions and a-x command option
knee-cola
Posts: 1
Joined: Thu 11 May 2017, 07:43

#5 Post by knee-cola »

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:

Code: Select all

# do not suspend if external monitor is connected
xrandr | grep "VGA1 connected" && exit
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:

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"
Post Reply