Lubuntu 14.04: how to avoid lock screen on closing laptop lid?

17,330

Solution 1

You're on the right track with logind.conf, but you only need to change this line from the default configuration:

HandleLidSwitch=ignore

(i.e. you don't need LidSwitchIgnoreInhibited=no).

In addition, you need to configure xfce4-power-manager to handle the lid switch. I found that the reliable way was to Quit it from the power manager icon menu before configuring it with

$ xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/logind-handle-lid-switch -s true

You'll then need to restart (unless there's another way to get logind to pick up its configuration, in which case I'd love to hear it!).

After this, the lid switch should operate according to the settings in the power manager.

I found this solution thanks to a comment on a bug linked by a helpful person in #xubuntu.

Note that this breaks screen locking on suspend.

Solution 2

I solved uninstalling xfce4-power-manager and rebooting. It could work because systemd and xfce4-power-manager are in conflict

Share:
17,330

Related videos on Youtube

gcali
Author by

gcali

Oh, freddled gruntbuggly, thy micturations are to me as plurdled gabbleblotchits on a lurgid bee. Groop, I implore thee, my foonting turlingdromes, and hooptiously drangle me with crinkly bindlewurdles, or I will rend thee in the gobberwarts with my blurglecruncheon, see if I don't!"

Updated on September 18, 2022

Comments

  • gcali
    gcali over 1 year

    I upgraded my OS from Lubuntu 13.10 to Lubuntu 14.04 a few days ago, and now my screen locks when the lid is closed, while I want nothing to happen when lid is closed.

    I have already set the right option in the Xfce power manager ("When laptop lid is closed: Nothing") and, as of https://bugs.launchpad.net/ubuntu/+source/xfce4-power-manager/+bug/1307545 and Closing laptop lid suspends Lubuntu, since upgrade , I tried editing /etc/systemd/logind.conf; but when I close the lid, the screen still locks and asks for a password. Note that this doesn't happen every time I close the screen; sometimes it stay closed for a few minutes and can be reopened without having been locked, and sometimes it locks as soon as I close the lid.

    For reference, here's the content of my /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
    #Controllers=
    #ResetControllers=cpu
    #InhibitDelayMaxSec=5
    #HandlePowerKey=poweroff
    #HandleSuspendKey=suspend
    #HandleHibernateKey=hibernate
    HandleLidSwitch=ignore
    #PowerKeyIgnoreInhibited=no
    #SuspendKeyIgnoreInhibited=no
    #HibernateKeyIgnoreInhibited=no
    LidSwitchIgnoreInhibited=no
    #IdleAction=ignore
    #IdleActionSec=30min
    

    Is there's something wrong with what I'm doing? What can I do to be able to close the lid without anything happening?

    EDIT: Possible pointers would be about what exactly happens when I close my lid; I tried investigating in that direction, but I don't know where to start. If a script or something is called on lid closing, I might even be content with modifying it to do nothing.

  • gcali
    gcali over 9 years
    It works, but I'd prefer to keep xfce4-power-manager... I'm going to see if I can look in the matter a little further, otherwise yours is the best solution as far as I can see
  • x29a
    x29a almost 9 years
    as for getting logind to read its config: $ restart systemd-logind
  • Ali
    Ali about 8 years
    This is the right answer. I can't believe there is no other way to accomplish this in Xubuntu.
  • phils
    phils over 7 years
    Since 15.04, sudo service systemd-logind restart to reload logind configuration. See askubuntu.com/a/372616
  • vladr
    vladr about 5 years
    Do NOT modify /etc/systemd/logind.conf directly, as it will be eventually overwritten by an update (happened to me the other day). Create a *.conf file under /etc/systemd/logind.conf.d instead (see man /etc/systemd/logind.conf).