How to: Leave windows unchanged on laptop lid close?

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Yoshi

How to: Leave windows unchanged on laptop lid close?

Post by Yoshi »

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
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
all41
Level 19
Level 19
Posts: 9520
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 »

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.
Everything in life was difficult before it became easy.
User avatar
lsemmens
Level 11
Level 11
Posts: 3949
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 »

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
Fully mint Household
Out of my mind - please leave a message
TopDownTom

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

Post by TopDownTom »

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.
powerchord84

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

Post by powerchord84 »

[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

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

Post by TopDownTom »

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

Return to “Xfce”