How to: Leave windows unchanged on laptop lid close?

Forum rules
Before you post please read how to get help
Post Reply
Yoshi
Level 1
Level 1
Posts: 4
Joined: Thu Oct 11, 2018 10:06 pm

How to: Leave windows unchanged on laptop lid close?

Post by Yoshi » Sun Oct 14, 2018 9:10 pm

Hi all, another question! I've been googling for a bit and I can't seem to find a way to do this (if at all possible).

Is it possible to leave my windows unchanged when I close the lid of my laptop? I'm currently running a dual-monitor setup (laptop screen + external monitor). Due to limited space on my desk, I'll often close my laptop lid to do something else, but doing so causes all my open windows (terminals, GUI windows, browsers, etc.) to all default to my external display - i.e. the system thinks it's only running the one monitor now.

Is there a setting/combination of settings that would allow my laptop screen to turn off/go black, but not actually "disconnect" from the system? I'd like to have all my windows stay where they are when I close my laptop lid.

Thanks all,

- Yoshi

User avatar
all41
Level 13
Level 13
Posts: 4990
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: How to: Leave windows unchanged on laptop lid close?

Post by all41 » Sun Oct 14, 2018 10:08 pm

Have you checked the Power Manager settings for what happens when you close the lid?
My laptop is still running 17.3--there is an option to blank the screen when the lid is closed.
Proud to be a supporter and monthly contributor to Mint.

User avatar
lsemmens
Level 6
Level 6
Posts: 1234
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: How to: Leave windows unchanged on laptop lid close?

Post by lsemmens » Mon Oct 15, 2018 7:33 am

If just set up XCFE on this laptop and turned off all power management settings. Tried closing the lid and re-opening it, I'm still here, So have a look in Power management. You did not say which desktop you were using, so the actual setting method may be different to XFCE
Kernel: 4.15.0-36-generic x86_64 bits: 64
Desktop: Cinnamon 3.8.9
Distro: Linux Mint 19 Tara

Laptop T4500 Dualcore 4Gb RAM
Server AMD Phenom 9650 - GEForce 9400GT 6Gb RAM
+ three other Linux Mint machines
Out of my mind - please leave a message

TopDownTom
Level 1
Level 1
Posts: 3
Joined: Thu Jul 12, 2018 9:18 pm

Re: How to: Leave windows unchanged on laptop lid close?

Post by TopDownTom » Wed Oct 24, 2018 7:44 am

Have you tried editing the logind.conf file? If not, this may be of some help.
Head over to:

Code: Select all

sudo nano /etc/systemd/logind.conf
and enter your password. Of course, nano can be replaced with your editor of choice.

At this point, you must un-comment the lines:

HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend
LidSwitchIgnoreInhibited=yes

The third line is a few down from the first two, but the first two are adjacent. These lines above will, when the switch is activated (lid closed), suspend the computer (sleep). They must be edited to say:

HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore
LidSwitchIgnoreInhibited=no

While I made this change to specifically prevent sleeping it may also work for your case because we're simply telling the computer to ignore the lid switch.

User avatar
powerchord84
Level 1
Level 1
Posts: 5
Joined: Fri Oct 26, 2018 10:51 am
Location: Alabama

Re: How to: Leave windows unchanged on laptop lid close?

Post by powerchord84 » Fri Oct 26, 2018 10:55 am

[SOLVED] My question was solved with the following link: viewtopic.php?t=214890

TopDownTom wrote:
Wed Oct 24, 2018 7:44 am
Have you tried editing the logind.conf file? If not, this may be of some help.
Head over to:

Code: Select all

sudo nano /etc/systemd/logind.conf
and enter your password. Of course, nano can be replaced with your editor of choice.

At this point, you must un-comment the lines:

HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend
LidSwitchIgnoreInhibited=yes

The third line is a few down from the first two, but the first two are adjacent. These lines above will, when the switch is activated (lid closed), suspend the computer (sleep). They must be edited to say:

HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore
LidSwitchIgnoreInhibited=no

While I made this change to specifically prevent sleeping it may also work for your case because we're simply telling the computer to ignore the lid switch.
Hi, I am having a problem where when I close the lid to my laptop, the system is going to sleep even though I have checked the option to "do nothing". I changed this in the gui power management settings. I have an external monitor connected and so I checked the "Perform lid-closed action even with external monitors attached" option.

I also just tried editing the file you mentioned above but I am still having the same problem.

I am running Cinnamon.

TopDownTom
Level 1
Level 1
Posts: 3
Joined: Thu Jul 12, 2018 9:18 pm

Re: How to: Leave windows unchanged on laptop lid close?

Post by TopDownTom » Tue Oct 30, 2018 7:27 am

Powerchord84, I'm glad you were able to find a solution.

Post Reply

Return to “Xfce”