An option for "close lid" on laptop

Bug #1359054 reported by Lars-Eivind Bjørtvedt on 2014-08-20
272
This bug affects 60 people
Affects Status Importance Assigned to Milestone
Switchboard Power Plug
Fix Released
High
kay van der Zander

Bug Description

I run Elementary Freya on a laptop.
I would like to set actions for when I close the lid on the laptop, but this option is missing.

ProblemType: Bug
DistroRelease: elementary OS 0.3
Package: elementary-desktop 1.349+393~ubuntu0.3.1 [origin: LP-PPA-elementary-os-daily]
ProcVersionSignature: Ubuntu 3.13.0-34.60-generic 3.13.11.4
Uname: Linux 3.13.0-34-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.3
Architecture: amd64
CrashDB: elementary_meta
CurrentDesktop: Pantheon
Date: Wed Aug 20 08:52:00 2014
InstallationDate: Installed on 2014-08-11 (8 days ago)
InstallationMedia: elementary OS 0.3 "Freya" - Daily amd64 (20140810)
SourcePackage: elementary-meta
SuspiciousXErrors:

ThirdParty: True
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Joel Almeida (joelalmeidaptg) wrote :

Plus, an option to set a time to turn off the screen is also missing. These are pretty major missing settings for laptop users.

Changed in elementaryos:
status: New → Confirmed
Changed in switchboard:
status: New → Confirmed
status: Confirmed → New
mporten (mathias-porten) on 2014-08-24
Changed in switchboard:
status: New → Confirmed
mporten (mathias-porten) on 2014-08-24
Changed in switchboard-plug-power:
status: New → Confirmed
petermolnar (petermolnar) wrote :

Please, this is a really important option for laptops.

petermolnar (petermolnar) wrote :

## Temporarily fixes

### for lid close options
* dconf editor -> org -> gnome -> settings daemon -> plugins -> power
  * edit lid-close-ac-action
  * edit lid-close-battery-action

### For screen off
* dconf editor -> org -> gnome -> desktop -> session
  * set idle-delay to the timeout you prefer
* dconf editor -> org -> gnome -> desktop -> screensaver
  * enable idle-activation-enabled

apt-get install gnome-screensaver

Daniel Fore (danrabbit) on 2014-11-02
no longer affects: switchboard
Dave Hartigan (dahartigan) wrote :

As of the last sudo apt-get update && sudo apt-get upgrade, I can confirm that this issue persists. It's times like this I really wish I knew how to code, or at least usefully in order to help.

Dave Hartigan (dahartigan) wrote :

I have just pushed a change (201) that adds the option below the sleep/hibernate/etc. This is my first time coding in Vala, first time using launchpad to fix a bug, so any feedback would be amazing.

Dave I tested your branch and nothing happens when I set it to Shutdown on
lid close.

On Sun, Dec 28, 2014 at 11:39 PM, Dave Hartigan <email address hidden>
wrote:

> I have just pushed a change (201) that adds the option below the
> sleep/hibernate/etc. This is my first time coding in Vala, first time
> using launchpad to fix a bug, so any feedback would be amazing.
>
> --
> You received this bug notification because you are subscribed to
> elementary OS.
> https://bugs.launchpad.net/bugs/1359054
>
> Title:
> Power settings does not have an option for "close lid" on laptop
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/elementaryos/+bug/1359054/+subscriptions
>

--
Cody Garver

Thanks for the feedback Cody! I am working on a solution to this, I will put the options underneath so we can choose lid on ac or on battery.

Learned a valuable lesson (well, lots so far, it's been great!) but that is to test, test, test before commit :)

Dave Hartigan (dahartigan) wrote :

I've updated my branch, and have tested it on my laptop (Acer Aspire 3680) and it functions as it should but as I am an absolute beginner I'm sure my code isn't pretty :P

Changed in switchboard-plug-power:
assignee: nobody → Dave Hartigan (dahartigan)
status: Confirmed → In Progress
Arnab Das (talktoarnab) wrote :

We all know elementary Freya does not have a power option for closing lid, by default it hibernates.
To deal with it i used a workaround in dconf editor to "do nothing" when lid is closed.
this was working well until recent update, where it is either hibernating or going into a "dead" state where its not waking up at all (its not shutting down).

The DCONF workaround is not working!!

Diego Madero (diego-madero) wrote :

Same proble here. After update, Dconf configuration for actions when close the laptop's lid is not working anymore :(
I think this is a very important function.

petermolnar (petermolnar) wrote :

Come on guys, we need this.
This is not a nice feature, this is a basic requirement.

Haaglin (haaglin) wrote :

This workaround worked for me:

sudo nano /etc/systemd/logind.conf

find line "#HandleLidSwitch=suspend"
Replace line with "HandleLidSwitch=ignore"

finaly, restart service:
sudo restart systemd-logind

Neither of the aforementioned workarounds have done much good here.

Changing the relevant settings with DConf did nothing.
Haaglin's workaround did make a difference, as it no longer goes into hibernation, but it does go into suspension.

I managed to get Elementary OS to ignore when I close the lid.

1 - sudo nano /etc/UPower/UPower.conf
2 - set "IgnoreLid" to true

Of course, all this lets you do is force it to ignore the lid switch events completely, but if you're having issues with it, that's probably the best course of action.

petermolnar (petermolnar) wrote :

Any devs listening here?

Cody (stillcms) wrote :

I agree this is necessary. When I close the lid my laptop turns off, but when I open it back up it freaks out. Please make a fix.

math (mathmartre) wrote :

+1

Radical Raccoon's solution works

petermolnar (petermolnar) wrote :

Are you really going to release Freya without a fix for this? :(

Dave Hartigan (dahartigan) wrote :

petermolnar: Unfortunately, it looks like it. :( I must say I am a little disappointed that this is now a feature regression for laptop users, which in 2015 I imagine would be substantial. Nice to see mine and other's efforts in fixing this issue seem to be ignored by those who do the reviewing...

petermolnar (petermolnar) wrote :

@Dave can I find your fix at any downloadable location?

Leo Herzog (xd1936) wrote :

Just installed the final release of Freya. Bummed about this bug, hoping for a fix soon!

Jose Fausto (chiapponebr) wrote :

I just can't believe this option ins't there. I'm really surprised and disappointed.

dankcushions (dankcushions) wrote :

FYI anyone after a quick fix - I only got the ignore lid lose to work after doing ALL the 3 solutions above. looks like there might be some redundancy here, so when you get it to ignore via one way, another process takes the wheel? Do all the 3 solutions and you should be ok :)

@dankcushions
Yeah I realized that it was actually necessary to perform all of the workarounds that have been suggested here after having to resolve this issue on another machine. Prior to this I had thought that all I had to do was perform the workaround I suggested since the previous workarounds seemed ineffective. Anyway, it's nice of you to let everyone know as I was actually about to do the same. ;D

Thankfully no updates have rendered these workarounds useless yet. Still hoping we eventually get a proper fix for this issue.

Marcelo Santos (marcelo-scs) wrote :

"I managed to get Elementary OS to ignore when I close the lid.

1 - sudo nano /etc/UPower/UPower.conf
2 - set "IgnoreLid" to true

Of course, all this lets you do is force it to ignore the lid switch events completely, but if you're having issues with it, that's probably the best course of action."

If you do that, when you plug a secondary monitor, the lid won't change to new monitor, until you do it manually.

The best solution for me, is that you change the logind.conf:

"This workaround worked for me:

sudo nano /etc/systemd/logind.conf

find line "#HandleLidSwitch=suspend"
Replace line with "HandleLidSwitch=ignore"

finaly, restart service:
sudo restart systemd-logind"

Jonathan H (d-linux-x) wrote :

Any updates on this?

I just used the logind.conf edit and it will suffice for now. However, a graphically editable configuration would be nice.

+1

It's ridiculous to not have this option yet!

Daniel Fore (danrabbit) on 2015-09-18
Changed in switchboard-plug-power:
milestone: none → loki-beta1
Changed in elementaryos:
milestone: none → loki-beta1
Cody Garver (codygarver) on 2015-09-22
Changed in elementaryos:
importance: Undecided → High
Changed in switchboard-plug-power:
importance: Undecided → High
Jani Iltanen (iltanen) wrote :

Yeah, this is pretty serious. My computer just shows a black screen when I close the lid, and I could not figure out how to get it working again so I just shut down the computer.

As elementary has the image of a newbie-friendly OS and many will consider this as their first GNU/Linux-based OS, this can really drive newcomers away... system stability should be the most important thing to get working. Also people that are not computer enthusiasts do not have a desktop computer any more, so this bug might lead thousands of users to view Elementary as just another hobbyist OS and not suitable for everyday use, if they downloaded Elementary just to try it out.

tatarin0 (3-eim-o) wrote :

!! SOLVED !!

So, I just downloaded latest Elem OS stable-0.3.1 and still had the issue closing lid my laptop (lenovo Y560p). I followed instructions above and did following:

------------------------------------
sudo nano /etc/systemd/logind.conf

find line "#HandleLidSwitch=suspend"
Replace line with "HandleLidSwitch=ignore"

finaly, restart service:
sudo restart systemd-logind
------------------------------------

This worked like a charm, tested on my laptop, hopefully this eventually be part of the GUI.

Laksa (elru-lakusa) wrote :

[SLOVED]
Setting from dconf editor
org.gnome.settings-daemon.plugins.power

Changed in switchboard-plug-power:
assignee: Dave Hartigan (dahartigan) → nobody
assignee: nobody → kay van der Zander (kay20)
Changed in elementaryos:
assignee: nobody → kay van der Zander (kay20)
Cody Garver (codygarver) on 2016-02-11
no longer affects: elementaryos
Shawn Caudill (sacaudill) wrote :

So I just did a clean, fresh, and new download and install of Elementary OS and ran all the updates but I still did not see the option to configure what happens when I close the lid on my laptop. I was going to try the DConf Editor workaround but I seen the post from 2016-02-11 that says "no longer affects:elementaryos" which made me wonder what that means? I don't have the feature, have all the latest updates so how could it no longer affect my beloved OS? Can someone please offer some insight on if this has been resolved and I'm missing something (surely not because I'm a sysadmin and I've been using Linux and Unix based systems for over 10 years now. Thank you all in advance for any updates or progress you can provide on this issue! :-)

kay van der Zander (kay20) wrote :

The package elementaryos didn't had the bug in the first place. The package power settings plug is the place where the bug is. It doesn't mean that elementary os is not effected by it and still had the feature then your wrong. Because the package elementaryos is the building script to build the total os. It is not the total code of the os.

It will be present when the status of this bug is changed to fix committed or fix released

Cody Garver (codygarver) on 2016-02-23
Changed in switchboard-plug-power:
assignee: kay van der Zander (kay20) → nobody
status: In Progress → Confirmed
Daniel Fore (danrabbit) on 2016-04-28
summary: - Power settings does not have an option for "close lid" on laptop
+ An option for "close lid" on laptop
Daniel Fore (danrabbit) on 2016-04-28
Changed in switchboard-plug-power:
status: Confirmed → In Progress
Daniel Fore (danrabbit) on 2016-04-30
Changed in switchboard-plug-power:
status: In Progress → Fix Committed
Changed in switchboard-plug-power:
assignee: nobody → kay van der Zander (kay20)
Cody Garver (codygarver) on 2016-08-12
Changed in switchboard-plug-power:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers