You are not logged in.

#1 2017-03-03 22:27:27

Phalkon
Member
Registered: 2014-10-19
Posts: 117

[SOLVED] xfce close-lid problem

Hi,

I need the system to lock the screen and suspend when I close the lid.
In XFCE I can set up power manager to suspend when lid is closed, but it won't lock the screen even when I have the security option to lock before suspending checked.

I tried to use logind to suspend and xfce to lock the screen, but xfce power manager inhibits logind.

┌─[phalkon@HAL9000]─[~]
└──╼ systemd-inhibit --list
     Who: NetworkManager (UID 0/root, PID 502/NetworkManager)
    What: sleep
     Why: NetworkManager needs to turn off networks
    Mode: delay

     Who: xfce4-power-manager (UID 1000/phalkon, PID 10011/xfce4-power-man)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch
     Why: xfce4-power-manager handles these events
    Mode: block

2 inhibitors listed.

I thought that setting

LidSwitchIgnoreInhibited=yes

in /etc/systemd/logind.conf would be enough to counter this, but it wasn't. Logind is still being inhibited by xfce4-power-manager. When power manager is not running, logind works.
What could be causing the ignoreinbitited option not to work? Is there any otherway to solve this? Can I prevent the power manager from creating the inhibitors in the first place?

OT: Also, why is the networkmanager inhibitor there? Is it really necessary to turn off networks before suspending? Can I perhaps disable that too?


EDIT: I just learned this:

Modern DE can use the special handle-lid-switch inhibitor, which should not be affected by this setting; I'm pretty sure that's what KDE already does. LidSwitchIgnoreInhibited= should only affect sleep inhibitors.

, which explains why the ignoreinhibited doesn't work.
I should probably figure out, why XFCE doesn't lock the screen when suspending by closing the lid.
In all other cases it does lock the screen (suspending when battery is low, suspending when the suspend button is pressed, etc.).

EDIT2: Found this command

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

that lets logind control lid switch. But that doesn't solve the locking problem, because now the xfpm settings don't have any effect and i needed it for the screen lock.

Last edited by Phalkon (2017-03-04 19:18:21)


Why Linux? Because it doesn't hide anything from you. It puts you so closely in control of your machine that you can feel its heartbeat.

Offline

#2 2017-03-03 23:38:01

Phalkon
Member
Registered: 2014-10-19
Posts: 117

Re: [SOLVED] xfce close-lid problem

xfpm settings:

/xfce4-power-manager/blank-on-ac                        10
/xfce4-power-manager/blank-on-battery                   10
/xfce4-power-manager/brightness-on-battery              9
/xfce4-power-manager/brightness-switch                  1
/xfce4-power-manager/brightness-switch-restore-on-exit  1
/xfce4-power-manager/critical-power-action              1
/xfce4-power-manager/critical-power-level               20
/xfce4-power-manager/dpms-enabled                       true
/xfce4-power-manager/dpms-on-ac-off                     12
/xfce4-power-manager/dpms-on-ac-sleep                   11
/xfce4-power-manager/dpms-on-battery-off                12
/xfce4-power-manager/dpms-on-battery-sleep              11
/xfce4-power-manager/general-notification               true
/xfce4-power-manager/handle-brightness-keys             false
/xfce4-power-manager/hibernate-button-action            2
/xfce4-power-manager/inactivity-on-ac                   15
/xfce4-power-manager/inactivity-on-battery              15
/xfce4-power-manager/inactivity-sleep-mode-on-battery   1
/xfce4-power-manager/lid-action-on-ac                   1
/xfce4-power-manager/lid-action-on-battery              1
/xfce4-power-manager/lock-screen-suspend-hibernate      true
/xfce4-power-manager/logind-handle-lid-switch           true
/xfce4-power-manager/power-button-action                4
/xfce4-power-manager/presentation-mode                  false
/xfce4-power-manager/show-tray-icon                     false
/xfce4-power-manager/sleep-button-action                0
/xfce4-power-manager/spin-down-on-ac                    false

I started the xfce4-power-manager in debug mode, started closing and opening the lid, but got no output whatsoever. It still does suspend the system however...


Why Linux? Because it doesn't hide anything from you. It puts you so closely in control of your machine that you can feel its heartbeat.

Offline

#3 2017-03-04 19:15:48

Phalkon
Member
Registered: 2014-10-19
Posts: 117

Re: [SOLVED] xfce close-lid problem

I solved the problem.

I was using modified xflock4 script for screen locking. It worked pretty well except for the suspending when closing the lid.
I still don't understand why the problem occurred only when closing the lid and not when pressing the suspend button, running out of battery or any other event that would cause suspend.

The solution was making xfpm use my own locking script instead of modifying xflock4. It can be done with this command:

xfconf-query -c xfce4-session -p /general/LockCommand -s "/opt/bin/phlock" --create -t string

Why Linux? Because it doesn't hide anything from you. It puts you so closely in control of your machine that you can feel its heartbeat.

Offline

Board footer

Powered by FluxBB