Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Power Off Display on Lid Close (NOT suspend!)

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
dabgdk
Posts: 7
Joined: 2012-10-10 18:49

Power Off Display on Lid Close (NOT suspend!)

#1 Post by dabgdk »

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/"?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

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

#2 Post by Head_on_a_Stick »

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
deadbang

dabgdk
Posts: 7
Joined: 2012-10-10 18:49

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

#3 Post by dabgdk »

/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).

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

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

#4 Post by Head_on_a_Stick »

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
deadbang

dabgdk
Posts: 7
Joined: 2012-10-10 18:49

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

#5 Post by dabgdk »

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

Should I install xfce4-power-manager-settings?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

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

#6 Post by Head_on_a_Stick »

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

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

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

#7 Post by GarryRicketson »

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
debiman
Posts: 3063
Joined: 2013-03-12 07:18

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

#8 Post by debiman »

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.

dabgdk
Posts: 7
Joined: 2012-10-10 18:49

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

#9 Post by dabgdk »

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

Thanks for your help.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

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

#10 Post by Head_on_a_Stick »

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


Post Reply