Results 1 to 5 of 5

Thread: [SOLVED]Kali Linux laptop lid close actions

  1. #1
    Join Date
    2015-Aug
    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
    +1...I was looking for this in the dconf, and the tweak-tool,but could not find the setting!

  3. #3
    Join Date
    2015-Dec
    Posts
    2

    Unhappy

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

  4. #4
    Join Date
    2015-Dec
    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 23:06. Reason: solved

  5. #5
    Join Date
    2017-Feb
    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.

Similar Threads

  1. Kali-Linux-laptop-lid-close-actions
    By stuartbh in forum General Archive
    Replies: 3
    Last Post: 2022-08-31, 18:46
  2. Replies: 0
    Last Post: 2019-07-09, 21:45
  3. Laptop lid close action Kali 2
    By Alpha-moe in forum General Archive
    Replies: 1
    Last Post: 2015-08-31, 14:01
  4. When I close my laptop, Kali2.0 get into hibernate mode
    By popdisk in forum General Archive
    Replies: 0
    Last Post: 2015-08-14, 12:52

Posting Permissions

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