You are not logged in.

#1 2025-02-04 15:45:54

makeworld
Member
Registered: 2019-10-24
Posts: 13

XFCE: Suspend laptop when closed even with display connected

I recently updating my system after not updating for a while, and now I've noticed some behaviour has changed. Previously when I closed my laptop it would suspend, even with a display connected. (Except when power was connected of course.)

Now it won't suspend if I close my laptop with my display is plugged in.

How can I go back to the old behaviour? I'm running XFCE. I also replaced my mainboard on this (Framework) laptop to the i7-1185G7 one, but I don't think that matters.

❯ xfconf-query -c xfce4-power-manager -l -v
/xfce4-power-manager/blank-on-ac                        0
/xfce4-power-manager/blank-on-battery                   0
/xfce4-power-manager/brightness-level-on-ac             100
/xfce4-power-manager/brightness-level-on-battery        10
/xfce4-power-manager/brightness-on-battery              90
/xfce4-power-manager/brightness-switch                  0
/xfce4-power-manager/brightness-switch-restore-on-exit  0
/xfce4-power-manager/critical-power-action              3
/xfce4-power-manager/critical-power-level               10
/xfce4-power-manager/dpms-enabled                       true
/xfce4-power-manager/dpms-on-ac-off                     0
/xfce4-power-manager/dpms-on-ac-sleep                   0
/xfce4-power-manager/dpms-on-battery-off                0
/xfce4-power-manager/dpms-on-battery-sleep              0
/xfce4-power-manager/general-notification               true
/xfce4-power-manager/handle-brightness-keys             true
/xfce4-power-manager/inactivity-sleep-mode-on-battery   1
/xfce4-power-manager/lid-action-on-ac                   3
/xfce4-power-manager/lid-action-on-battery              1
/xfce4-power-manager/lock-screen-suspend-hibernate      true
/xfce4-power-manager/logind-handle-lid-switch           false
/xfce4-power-manager/presentation-mode                  false
/xfce4-power-manager/show-panel-label                   3
/xfce4-power-manager/show-presentation-indicator        true
/xfce4-power-manager/show-tray-icon                     false
❯ cat /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.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the logind.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# Use 'systemd-analyze cat-config systemd/logind.conf' to display the full config.
#
# See logind.conf(5) for details.

[Login]

HandleLidSwitch=suspend-then-hibernate
HandleLidSwitchExternalPower=lock
HandleLidSwitchDocked=suspend-then-hibernate

#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#UserStopDelaySec=10
#HandlePowerKey=poweroff
#HandlePowerKeyLongPress=ignore
#HandleRebootKey=reboot
#HandleRebootKeyLongPress=poweroff
#HandleSuspendKey=suspend
#HandleSuspendKeyLongPress=hibernate
#HandleHibernateKey=hibernate
#HandleHibernateKeyLongPress=ignore
#HandleLidSwitch=suspend
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#RebootKeyIgnoreInhibited=no
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RuntimeDirectoryInodesMax=
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192

Offline

#2 2025-02-04 17:48:05

lambdarch
Member
From: France
Registered: 2021-01-10
Posts: 88
Website

Re: XFCE: Suspend laptop when closed even with display connected

makeworld wrote:

How can I go back to the old behaviour?

Right now you can't.

In general, the opposite behavior was expected, and xfce4-power-manager was inconsistent from this point of view (some action choices when closing the lid applied when an external screen was connected and others did not). So this has been made consistent in favor of activating the action only if no external screen is connected.

The old behavior is now the subject of a feature request: https://gitlab.xfce.org/xfce/xfce4-powe … issues/203

Offline

#3 2025-02-20 19:42:47

lambdarch
Member
From: France
Registered: 2021-01-10
Posts: 88
Website

Re: XFCE: Suspend laptop when closed even with display connected

You should be able to use HandleLidSwitchDocked in logind.conf over xfce4-power-manager I think. For some reason I can't get it to work here, but it should be possible, without changing anything in the xfce4-power-manager configuration (I think...)

EDIT: you probably have to set this actually:

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

Last edited by lambdarch (2025-02-20 21:51:21)

Offline

#4 2025-02-20 21:53:27

makeworld
Member
Registered: 2019-10-24
Posts: 13

Re: XFCE: Suspend laptop when closed even with display connected

I can't get it to work either, that's kind of my issue. If you look at my original post, I do have HandleLidSwitchDocked set. It used to work (or XFCE used to still ignore it but behaved differently), and now my laptop won't suspend when docked anymore.

I appreciate you linking the feature request, it's a little confusing given that it's a year old but at least something is being tracked.

Offline

#5 2025-02-20 21:58:22

lambdarch
Member
From: France
Registered: 2021-01-10
Posts: 88
Website

Re: XFCE: Suspend laptop when closed even with display connected

Does setting logind-handle-lid-switch to true help?

Offline

#6 2025-02-20 22:15:51

makeworld
Member
Registered: 2019-10-24
Posts: 13

Re: XFCE: Suspend laptop when closed even with display connected

Ah that worked, thanks. I think in the past I used XFCE because it used to support suspending when docked but not suspending when docked and powered, which logind doesn't support. But at least this is better than the current XFCE behaviour.

Offline

#7 2025-02-27 19:43:57

lambdarch
Member
From: France
Registered: 2021-01-10
Posts: 88
Website

Re: XFCE: Suspend laptop when closed even with display connected

I just merged adding a new setting for that: https://gitlab.xfce.org/xfce/xfce4-powe … 75abb59227 It'll only be available in 4.21.0 though (not backported to 4.20.x).

Offline

Board footer

Powered by FluxBB