Results 1 to 5 of 5

Thread: [SOLVED]Kali Linux laptop lid close actions

  1. #1
    Junior Member
    Join Date
    Aug 2015
    Posts
    1

    [SOLVED]Kali Linux laptop lid close actions

    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)
    Code:
    nano /etc/systemd/logind.conf
    Example of content of logind.conf
    Code:
    #  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:
    Code:
    #  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
    Code:
    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

  2. #2
    Junior Member
    Join Date
    Aug 2015
    Posts
    3
    +1...I was looking for this in the dconf, and the tweak-tool,but could not find the setting!

  3. #3
    Junior Member
    Join Date
    Dec 2015
    Posts
    2

    Unhappy

    double post, sorry
    please delete
    Last edited by Falco; 2015-12-11 at 11:02 PM. Reason: double post, sorry

  4. #4
    Junior Member
    Join Date
    Dec 2015
    Posts
    2
    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... :/
    Last edited by Falco; 2015-12-11 at 11:06 PM. Reason: solved

  5. #5
    Junior Member
    Join Date
    Feb 2017
    Location
    Kingston Ontario Canada
    Posts
    1
    Easy way. Go into Tweak tool. Click on power. There is an option to not suspend when lid is closed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •