PDA

View Full Version : [SOLVED]Kali Linux laptop lid close actions



rb4sh
2015-08-22, 16:28
This post show multiple methods on how you can set computer behaviour when closing laptop lid.
This methods was successfully tested on Kali Linux 2 x86 GNOME installed on a USB thumb drive.

1st Option: Check power setting and Gnome-Tweak-Tool. If there is no option about laptop-lid-action then move to 2nd Option otherwise just adjust the settings as required.

2nd Option: Run dconf-editor then go "org->gnome->settings-daemon->plugins->power". Here you should have the possibility to set various options(buttons actions,sleep,etc.). Among them you should have the 'lid-close-battery-action' and 'lid-close-ac-action settings'. If not move to 3 Option otherwise adjust the settings as required.

3rd Option: Manually edit logind.conf (must be root)

nano /etc/systemd/logind.conf

Example of content of 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.
#
# 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=suspend
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes


Just uncomment the "HandleLidSwitch=suspend" and change 'suspend' to the most appropriate option (ignore,halt,poweroff,kexec,hibernate,reboot,lock) .

Ex. /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.
#
# 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=kexec #Will keep computer running as the lid was not closed
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes


Now just restart logind
systemctl restart systemd-logind or reboot your system.
Done. Now everything should work as expected.

Hope it helps. For any suggestion please ask. Thanks
rb4sh

CryptonicNetwork
2015-08-25, 19:33
+1...I was looking for this in the dconf, and the tweak-tool,but could not find the setting!

Falco
2015-12-11, 21:04
double post, sorry
please delete

Falco
2015-12-11, 21:13
I'm kind frustrated because none of the above do anything for me.
Option 1 doesn't show up.
Using dconf-editor I did change the options to 'blank', as this did disable my monitor (black screen), while keeping everything else running (in kali 1).
It was still set like this because I upgraded from kali 1 to 2 with dist-upgrade
I tested it with 'nothing', but my laptop would still suspend.
Changing logind.conf does nothing for me either. Tested 'blank' and 'nothing'. I did uncomment the line, by the way. And I did restart the system service.

Whenever I close the lid it would suspend.
Also what's kexec supposed to mean?
While at it, my monitor brightness isn't adjustable anymore either... It's always on full brightness now, used to be able to change that with kali 1

edit: solved. It's not 'nothing' it's 'ignore'. in logind.conf
Silly me... :/

furryface47
2017-02-23, 16:27
Easy way. Go into Tweak tool. Click on power. There is an option to not suspend when lid is closed.