An option for "close lid" on laptop

Bug #1359054 reported by Lars-Eivind Bjørtvedt
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

Revision history for this message
Lars-Eivind Bjørtvedt (larseivind-bjoertvedt) wrote :
Revision history for this message
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)
Changed in switchboard:
status: New → Confirmed
mporten (mathias-porten)
Changed in switchboard-plug-power:
status: New → Confirmed
Revision history for this message
petermolnar (petermolnar) wrote :

Please, this is a really important option for laptops.

Revision history for this message
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

no longer affects: switchboard
Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
Cody Garver (codygarver) wrote : Re: [Bug 1359054] Re: Power settings does not have an option for "close lid" on laptop

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

Revision history for this message
Dave Hartigan (dahartigan) wrote : Re: Power settings does not have an option for "close lid" on laptop

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 :)

Revision history for this message
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
Revision history for this message
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!!

Revision history for this message
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.

Revision history for this message
petermolnar (petermolnar) wrote :

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

Revision history for this message
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

Revision history for this message
Radical Raccoon (radicalraccoon) wrote :

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.

Revision history for this message
Radical Raccoon (radicalraccoon) 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.

Revision history for this message
petermolnar (petermolnar) wrote :

Any devs listening here?

Revision history for this message
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.

Revision history for this message
math (mathmartre) wrote :

+1

Radical Raccoon's solution works

Revision history for this message
petermolnar (petermolnar) wrote :

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

Revision history for this message
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...

Revision history for this message
petermolnar (petermolnar) wrote :

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

Revision history for this message
Leo Herzog (xd1936) wrote :

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

Revision history for this message
Jose Fausto (chiapponebr) wrote :

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

Revision history for this message
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 :)

Revision history for this message
Radical Raccoon (radicalraccoon) wrote :

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

Revision history for this message
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"

Revision history for this message
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.

Revision history for this message
Willian Tenfen Wazilewski (tw-willian) wrote :

+1

It's ridiculous to not have this option yet!

Changed in switchboard-plug-power:
milestone: none → loki-beta1
Changed in elementaryos:
milestone: none → loki-beta1
Cody Garver (codygarver)
Changed in elementaryos:
importance: Undecided → High
Changed in switchboard-plug-power:
importance: Undecided → High
Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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)
no longer affects: elementaryos
Revision history for this message
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! :-)

Revision history for this message
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)
Changed in switchboard-plug-power:
assignee: kay van der Zander (kay20) → nobody
status: In Progress → Confirmed
summary: - Power settings does not have an option for "close lid" on laptop
+ An option for "close lid" on laptop
Changed in switchboard-plug-power:
status: Confirmed → In Progress
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)
Changed in switchboard-plug-power:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.