Power Off Display on Lid Close (NOT suspend!)

Kernels & Hardware, configuring network, installing services

Power Off Display on Lid Close (NOT suspend!)

Postby dabgdk » 2017-03-18 15:04

I want my LCD backlight to turn off when I close the lid of my laptop, while leaving the laptop running.

Code: Select all
xset -display :0.0 dpms force off


That command does exactly what I want.

I currently have "HandleLidSwitch" set to "ignore" in /etc/systemd/logind.conf - is there a way to set it to "script"? Could I make a script under "/etc/systemd/system/"?
dabgdk
 
Posts: 7
Joined: 2012-10-10 18:49

Re: Power Off Display on Lid Close (NOT suspend!)

Postby Head_on_a_Stick » 2017-03-18 15:44

dabgdk wrote:I currently have "HandleLidSwitch" set to "ignore" in /etc/systemd/logind.conf

That method works for my Openbox/tint2 desktop (with no other power management solutions running).

Please post the full, exact contents of /etc/systemd/logind.conf so that we can check the file for errors.

Here is my version, this works for me:
Code: Select all
Helium: ~ $ cat /etc/systemd/logind.conf                                                 
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See logind.conf(5) for details.

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
HandleLidSwitch=ignore
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192
#UserTasksMax=33%

Did you remember to remove the comment when you changed the HandleLidSwitch line?

Please also post the output of:
Code: Select all
systemd-inhibit
“Such is modern computing: everything simple is made too complicated because it’s easy to fiddle with; everything complicated stays complicated because it’s hard to fix." — Rob Pike

Please read before posting How to report a problem
User avatar
Head_on_a_Stick
 
Posts: 6419
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Power Off Display on Lid Close (NOT suspend!)

Postby dabgdk » 2017-03-18 19:55

/etc/systemd/logind.conf

Code: Select all
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# See logind.conf(5) for details

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
HandlePowerKey=suspend
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
HandleLidSwitch=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes


systemd-inhibit

Code: Select all
0 inhibitors listed.


Ran as root, and then again as regular user.

If I close the lid, my display remains on (suspend does not occur, which is good- but I want the backlight to turn off).
dabgdk
 
Posts: 7
Joined: 2012-10-10 18:49

Re: Power Off Display on Lid Close (NOT suspend!)

Postby Head_on_a_Stick » 2017-03-18 20:05

dabgdk wrote:If I close the lid, my display remains on (suspend does not occur, which is good- but I want the backlight to turn off).

Have you tried
Code: Select all
xfce4-power-manager-settings

Then:

General → Laptop Lid → When laptop lid is closed → Switch off display
“Such is modern computing: everything simple is made too complicated because it’s easy to fiddle with; everything complicated stays complicated because it’s hard to fix." — Rob Pike

Please read before posting How to report a problem
User avatar
Head_on_a_Stick
 
Posts: 6419
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Power Off Display on Lid Close (NOT suspend!)

Postby dabgdk » 2017-03-18 22:23

Command not found. (Probably because this is LXDE).

Should I install xfce4-power-manager-settings?
dabgdk
 
Posts: 7
Joined: 2012-10-10 18:49

Re: Power Off Display on Lid Close (NOT suspend!)

Postby Head_on_a_Stick » 2017-03-18 22:28

dabgdk wrote:this is LXDE

Damn, my crystal ball must be broken...

Use the power management tools of that desktop then, perhaps?
Last edited by Head_on_a_Stick on 2017-03-19 09:30, edited 1 time in total.
“Such is modern computing: everything simple is made too complicated because it’s easy to fiddle with; everything complicated stays complicated because it’s hard to fix." — Rob Pike

Please read before posting How to report a problem
User avatar
Head_on_a_Stick
 
Posts: 6419
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Power Off Display on Lid Close (NOT suspend!)

Postby GarryRicketson » 2017-03-18 23:16

I am not familiar with LXDE either, all though I have heard of it.
Some search results show,..

https://www.startpage.com/do/search/do/?q=%20power%20management%20tools%20fo%20LXDE

from: https://wiki.mageia.org/en/First_step_with_LXDEPower Management
(For Laptops) No one
But it is possible to install one from third parties
User avatar
GarryRicketson
 
Posts: 3770
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Power Off Display on Lid Close (NOT suspend!)

Postby debiman » 2017-03-19 07:33

dabgdk wrote:Should I install xfce4-power-manager-settings?

thankfully most xfce components are modest in dependency requirements and can be used without installing the full desktop, so yes, you can, if LXDE doesn't have its own.
User avatar
debiman
 
Posts: 834
Joined: 2013-03-12 07:18

Re: Power Off Display on Lid Close (NOT suspend!)

Postby dabgdk » 2017-03-19 11:26

I destroyed that install trying to setup NVIDIA drivers. Boot brings me to shell.

Thanks for your help.
dabgdk
 
Posts: 7
Joined: 2012-10-10 18:49

Re: Power Off Display on Lid Close (NOT suspend!)

Postby Head_on_a_Stick » 2017-03-19 11:27

dabgdk wrote:I destroyed that install [...] Boot brings me to shell.

Sounds perfectly serviceable to me :)

Why not just re-configure your graphics stack? It would be quicker than re-installing.
“Such is modern computing: everything simple is made too complicated because it’s easy to fiddle with; everything complicated stays complicated because it’s hard to fix." — Rob Pike

Please read before posting How to report a problem
User avatar
Head_on_a_Stick
 
Posts: 6419
Joined: 2014-06-01 17:46
Location: /dev/chair



Return to System configuration

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable