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
"Are you quite sure that all those bells and whistles, all those wonderful facilities of your so called powerful programming languages, belong to the solution set rather than the problem set?" — Edsger W. Dijkstra
User avatar
Head_on_a_Stick
 
Posts: 6606
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
"Are you quite sure that all those bells and whistles, all those wonderful facilities of your so called powerful programming languages, belong to the solution set rather than the problem set?" — Edsger W. Dijkstra
User avatar
Head_on_a_Stick
 
Posts: 6606
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.
"Are you quite sure that all those bells and whistles, all those wonderful facilities of your so called powerful programming languages, belong to the solution set rather than the problem set?" — Edsger W. Dijkstra
User avatar
Head_on_a_Stick
 
Posts: 6606
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
"What we expect you have already Done"

Before doing anything, read the Debian documentation:
Debian Documentation
How to ask the smart way
Debian Foro Español
======================
For the Birds
User avatar
GarryRicketson
 
Posts: 4279
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: 1341
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.
"Are you quite sure that all those bells and whistles, all those wonderful facilities of your so called powerful programming languages, belong to the solution set rather than the problem set?" — Edsger W. Dijkstra
User avatar
Head_on_a_Stick
 
Posts: 6606
Joined: 2014-06-01 17:46
Location: /dev/chair



Return to System configuration

Who is online

Users browsing this forum: No registered users and 16 guests

fashionable