Subject: bug#479: xcfe4-power-manager: Can't configure laptop lid

From: Michaela Merz <[email-masked]>
Date: Tue, 2 Jun 2020 18:25:09 -0500

Package: xcfe4-power-manager
Version: 1.6.1-1 amd64

Devuan Beowulf, 4-19.0-9-amd64, Installed on Lenovo T460 (Laptop)

Unable to configure suspend/resume (laptop lid). No luck with pm-utils
installed. Created a work-around with acpid and script in /etc/acpi.
However, xfce4-session-logout -s actually puts laptop into suspend to ram.

This worked in ASCII

---

From: Mark Hindley <[email-masked]>
Date: Wed, 3 Jun 2020 10:25:53 +0100

Michaela,

>    However, xfce4-session-logout -s actually puts laptop into suspend to

Do you have an elogind or consolekit based installation? 

Do you have the correct policykit libraries installed?

Please show the output of `dpkg -l | egrep 'logind|consolekit|policykit|polkit'`

Thanks.

Mark

---

From: Michaela Merz <[email-masked]>
Date: Wed, 3 Jun 2020 12:04:32 -0500

Hey Mark - hope you are not doing all the work alone. Thanks for your help.
Here is the requested policykit listing:

ii  elogind                               241.4-2
  amd64        user, seat and session management daemon
ii  gir1.2-polkit-1.0                     0.105-25+devuan8
   amd64        GObject introspection data for PolicyKit
ii  libelogind0:amd64                     241.4-2
  amd64        user, seat and session management library
ii  libpam-elogind:amd64                  241.4-2
  amd64        elogind PAM module
ii  libpolkit-agent-1-0:amd64             0.105-25+devuan8
   amd64        PolicyKit Authentication Agent API
ii  libpolkit-backend-1-0                 0.105-25+devuan8
   all          PolicyKit Authorization API
ii  libpolkit-backend-elogind-1-0:amd64   0.105-25+devuan8
   amd64        PolicyKit backend API
ii  libpolkit-gobject-1-0                 0.105-25+devuan8
   all          PolicyKit Authorization API
ii  libpolkit-gobject-elogind-1-0:amd64   0.105-25+devuan8
   amd64        PolicyKit Authorization API
ii  policykit-1                           0.105-25+devuan8
   amd64        framework for managing administrative policies and
privileges
ii  policykit-1-gnome                     0.105-7
  amd64        authentication agent for PolicyKit

Cheers
Michaela

---

From: Mark Hindley <[email-masked]>
Date: Wed, 3 Jun 2020 20:27:16 +0100

On Wed, Jun 03, 2020 at 12:04:32PM -0500, Michaela Merz wrote:
>    Hey Mark - hope you are not doing all the work alone. Thanks for your
>    help. Here is the requested policykit listing:
>    ii  elogind                               241.4-2

OK. That looks fine.

So You need to use either xfce4-power-manager/pm-utils or elogind for this, but
not both.

Details are available at https://docs.xfce.org/xfce/xfce4-power-manager/faq and
in man logind.conf(5) (particularly the HandleLidSwitch* options).

How have you tried to set this up and exactly what doesn't work?

Is xfce4-power-manager actually running?

If it still isn't working please enable xfce4-power-manager debugging:

 xfce4-power-manager -q
 xfce4-power-manager --no-daemon --debug

and see what it reports when it runs.

Thanks.

Mark

---

From: Mark Hindley <[email-masked]>
Date: Thu, 4 Jun 2020 09:52:37 +0100

Michaela,

Thanks.

One other thing that has occurred to me: is the kernel finding and enabling the
lid switch? What make of laptop is it? Does /proc/acpi/button/lid/LID0/ exist?

It could be a problem at the kernel/harware level.

Mark

---

From: Michaela Merz <[email-masked]>
Date: Wed, 3 Jun 2020 18:45:47 -0500

Mark:

I installed vanilla Devuan Beowulf and noticed, that the power-manager
didn't give me an option to suspend on laptop lid. There also was no option
to suspend in the system settings. I installed pm-utis and rebooted and on
the first try, the power-manager offered "suspend" on laptop-lid, but it
didn't do anything. Subsequent calls to power manager had the "suspend"
options removed again.

I called it a day and installed acpid because it allows me to run scripts
on events. I created a laptop-lif script script that echo "mem" >>
/sys/power/state and, though a bit hacky, it works fine.

Here's the requested output:

** (xfce4-power-manager:9707): WARNING **: 18:43:58.202: Failed to get name
owner: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not get
owner of name 'org.freedesktop.PowerManagement': no such name

** (xfce4-power-manager:9707): WARNING **: 18:43:58.202: Failed to get name
owner: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not get
owner of name 'org.xfce.PowerManager': no such name

(xfce4-power-manager:9707): GLib-GObject-WARNING **: 18:43:58.215:
../../../gobject/gsignal.c:2523: signal 'Changed' is invalid for instance
'0x55599ae301b0' of type 'GDBusProxy'

(xfce4-power-manager:9707): xfce4-power-manager-WARNING **: 18:43:58.235:
could not map keysym 1008ffa8 to keycode

TRACE[xfpm-main.c:205] xfpm_start(): Starting the power manager
TRACE[xfpm-xfconf.c:165] xfpm_xfconf_load(): Using default configuration
for lock-screen-suspend-hibernate
TRACE[xfpm-xfconf.c:165] xfpm_xfconf_load(): Using default configuration
for critical-power-level
TRACE[xfpm-xfconf.c:165] xfpm_xfconf_load(): Using default configuration
for show-brightness-popup
TRACE[xfpm-xfconf.c:165] xfpm_xfconf_load(): Using default configuration
for handle-brightness-keys
TRACE[xfpm-xfconf.c:165] xfpm_xfconf_load(): Using default configuration
for hibernate-button-action
TRACE[xfpm-xfconf.c:165] xfpm_xfconf_load(): Using default configuration
for sleep-button-action
TRACE[xfpm-xfconf.c:165] xfpm_xfconf_load(): Using default configuration
for brightness-level-on-ac
TRACE[xfpm-xfconf.c:165] xfpm_xfconf_load(): Using default configuration
for brightness-level-on-battery
TRACE[xfpm-xfconf.c:165] xfpm_xfconf_load(): Using default configuration
for brightness-slider-min-level
TRACE[xfpm-xfconf.c:165] xfpm_xfconf_load(): Using default configuration
for dpms-enabled
TRACE[xfpm-xfconf.c:165] xfpm_xfconf_load(): Using default configuration
for dpms-sleep-mode
TRACE[xfpm-xfconf.c:165] xfpm_xfconf_load(): Using default configuration
for inactivity-on-ac
TRACE[xfpm-xfconf.c:165] xfpm_xfconf_load(): Using default configuration
for inactivity-sleep-mode-on-ac
TRACE[xfpm-xfconf.c:165] xfpm_xfconf_load(): Using default configuration
for network-manager-sleep
TRACE[xfpm-xfconf.c:165] xfpm_xfconf_load(): Using default configuration
for logind-handle-power-key
TRACE[xfpm-xfconf.c:165] xfpm_xfconf_load(): Using default configuration
for logind-handle-suspend-key
TRACE[xfpm-xfconf.c:165] xfpm_xfconf_load(): Using default configuration
for logind-handle-hibernate-key
TRACE[xfpm-xfconf.c:165] xfpm_xfconf_load(): Using default configuration
for heartbeat-command
TRACE[xfpm-dpms.c:75] xfpm_dpms_set_timeouts(): Settings dpms: standby=3600
suspend=0 off=3600

TRACE[xfpm-polkit.c:287] xfpm_polkit_init_data(): Using unix session polkit
subject
TRACE[xfpm-polkit.c:345] xfpm_polkit_check_auth_intern(): polkit request:
(('unix-process', {'pid': <uint32 9707>, 'start-time': <uint64 2432178>}),
'org.freedesktop.login1.power-off', @a{ss} {}, uint32 0, '')
TRACE[xfpm-polkit.c:366] xfpm_polkit_check_auth_intern():
Action=org.freedesktop.login1.power-off is authorized=TRUE
TRACE[xfpm-polkit.c:345] xfpm_polkit_check_auth_intern(): polkit request:
(('unix-process', {'pid': <uint32 9707>, 'start-time': <uint64 2432178>}),
'org.freedesktop.login1.reboot', @a{ss} {}, uint32 0, '')
TRACE[xfpm-polkit.c:366] xfpm_polkit_check_auth_intern():
Action=org.freedesktop.login1.reboot is authorized=TRUE
TRACE[xfpm-polkit.c:345] xfpm_polkit_check_auth_intern(): polkit request:
(('unix-process', {'pid': <uint32 9707>, 'start-time': <uint64 2432178>}),
'org.freedesktop.login1.suspend', @a{ss} {}, uint32 0, '')
TRACE[xfpm-polkit.c:366] xfpm_polkit_check_auth_intern():
Action=org.freedesktop.login1.suspend is authorized=TRUE
TRACE[xfpm-polkit.c:345] xfpm_polkit_check_auth_intern(): polkit request:
(('unix-process', {'pid': <uint32 9707>, 'start-time': <uint64 2432178>}),
'org.freedesktop.login1.hibernate', @a{ss} {}, uint32 0, '')
TRACE[xfpm-polkit.c:366] xfpm_polkit_check_auth_intern():
Action=org.freedesktop.login1.hibernate is authorized=TRUE
TRACE[xfpm-power.c:936] xfpm_power_get_power_devices(): Power device
detected at : /org/freedesktop/UPower/devices/line_power_AC
TRACE[xfpm-power.c:898] xfpm_power_add_device(): 'line-power' device added
TRACE[xfpm-power.c:936] xfpm_power_get_power_devices(): Power device
detected at : /org/freedesktop/UPower/devices/battery_BAT0
TRACE[xfpm-power.c:898] xfpm_power_add_device(): 'battery' device added
TRACE[xfpm-power.c:908] xfpm_power_add_device(): Battery device type
'battery' detected at: /org/freedesktop/UPower/devices/battery_BAT0
TRACE[xfpm-button.c:183] xfpm_button_xevent_key(): Grabbed key 124 :
((XfpmButtonKey) BUTTON_POWER_OFF)
TRACE[xfpm-button.c:183] xfpm_button_xevent_key(): Grabbed key 213 :
((XfpmButtonKey) BUTTON_HIBERNATE)
TRACE[xf
(xfce4-power-manager:9707): GLib-CRITICAL **: 18:43:58.247: g_error_free:
assertion 'error != NULL' failed

** (xfce4-power-manager:9707): WARNING **: 18:43:58.248: No outputs have
backlight property
xfce4-power-manager-Message: 18:43:58.264: Set kernel brightness switch to 0
xfce4-power-manager-Message: 18:44:04.142: Restored brightness switch value
to: 1

(xfce4-power-manager:9707): Gtk-WARNING **: 18:44:04.142: A floating object
was finalized. This means that someone
called g_object_unref() on an object that had only a floating
reference; the initial floating reference is not owned by anyone
and must be removed with g_object_ref_sink().

(xfce4-power-manager:9707): Gtk-WARNING **: 18:44:04.142: A floating object
was finalized. This means that someone
called g_object_unref() on an object that had only a floating
reference; the initial floating reference is not owned by anyone
and must be removed with g_object_ref_sink().
pm-button.c:183] xfpm_button_xevent_key(): Grabbed key 150 :
((XfpmButtonKey) BUTTON_SLEEP)
TRACE[xfpm-button.c:183] xfpm_button_xevent_key(): Grabbed key 233 :
((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_UP)
TRACE[xfpm-button.c:183] xfpm_button_xevent_key(): Grabbed key 232 :
((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-button.c:183] xfpm_button_xevent_key(): Grabbed key 244 :
((XfpmButtonKey) BUTTON_BATTERY)
TRACE[xfpm-button.c:183] xfpm_button_xevent_key(): Grabbed key 238 :
((XfpmButtonKey) BUTTON_KBD_BRIGHTNESS_UP)
TRACE[xfpm-button.c:183] xfpm_button_xevent_key(): Grabbed key 237 :
((XfpmButtonKey) BUTTON_KBD_BRIGHTNESS_DOWN)
TRACE[xfpm-power.c:936] xfpm_power_get_power_devices(): Power device
detected at : /org/freedesktop/UPower/devices/battery_BAT1
TRACE[xfpm-power.c:898] xfpm_power_add_device(): 'battery' device added
TRACE[xfpm-power.c:908] xfpm_power_add_device(): Battery device type
'battery' detected at: /org/freedesktop/UPower/devices/battery_BAT1
TRACE[xfpm-dpms.c:75] xfpm_dpms_set_timeouts(): Settings dpms: standby=1260
suspend=0 off=1560

TRACE[xfpm-dpms.c:348] xfpm_dpms_set_on_battery(): dpms on battery TRUE
TRACE[xfpm-power.c:1446] xfpm_update_blank_time(): Timeout: 10
TRACE[xfpm-power.c:1446] xfpm_update_blank_time(): Timeout: 10
TRACE[xfpm-power.c:213] xfpm_power_check_polkit_auth(): using logind
suspend backend
TRACE[xfpm-polkit.c:345] xfpm_polkit_check_auth_intern(): polkit request:
(('unix-process', {'pid': <uint32 9707>, 'start-time': <uint64 2432178>}),
'org.freedesktop.login1.suspend', @a{ss} {}, uint32 0, '')
TRACE[xfpm-polkit.c:366] xfpm_polkit_check_auth_intern():
Action=org.freedesktop.login1.suspend is authorized=TRUE
TRACE[xfpm-polkit.c:345] xfpm_polkit_check_auth_intern(): polkit request:
(('unix-process', {'pid': <uint32 9707>, 'start-time': <uint64 2432178>}),
'org.freedesktop.login1.hibernate', @a{ss} {}, uint32 0, '')
TRACE[xfpm-polkit.c:366] xfpm_polkit_check_auth_intern():
Action=org.freedesktop.login1.hibernate is authorized=TRUE
TRACE[xfpm-power.c:1446] xfpm_update_blank_time(): Timeout: 10
TRACE[xfpm-power.c:1446] xfpm_update_blank_time(): Timeout: 10
TRACE[xfpm-power.c:1446] xfpm_update_blank_time(): Timeout: 13
TRACE[xfpm-power.c:1446] xfpm_update_blank_time(): Timeout: 13
TRACE[xfpm-manager.c:645] xfpm_manager_inhibit_sleep_systemd(): Inhibiting
systemd sleep: handle-power-key:handle-suspend-key:handle-hibernate-key
TRACE[xfpm-backlight.c:256]
xfpm_backlight_brightness_on_ac_settings_changed(): Alarm on ac timeout
changed 120
TRACE[xfpm-backlight.c:277]
xfpm_backlight_brightness_on_battery_settings_changed(): Alarm on battery
timeout changed 120
TRACE[xfpm-main.c:68] xfpm_quit_signal(): sig 2
TRACE[xfpm-manager.c:939] xfpm_manager_stop(): Stopping
TRACE[xfpm-manager.c:266] xfpm_manager_quit(): Exiting
TRACE[xfpm-polkit.c:244] xfpm_polkit_free_data(): Destroying Polkit data

On Wed, Jun 3, 2020 at 2:27 PM Mark Hindley <[email-masked]> wrote:

> Details are available at
> https://docs.xfce.org/xfce/xfce4-power-manager/faq and

---

From: Mark Hindley <[email-masked]>
Date: Thu, 4 Jun 2020 12:10:01 +0100

Michaela,

Could you tell me what

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

returns? If is it true (which I suspect), does

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

fix the behaviour?

Thanks.

Mark

---

From: Mark Hindley <[email-masked]>
Date: Tue, 16 Jun 2020 10:48:48 +0100

On Mon, Jun 15, 2020 at 01:02:43PM -0500, Patrick wrote:
> Hi Mark, sorry to butt in mid thread.  Having this same issue on a Lenovo
> T61.  The directory you reference below is /proc/acpi/button/lid/LID on this
> laptop with Beowulf newly updated.  I can confirm that state does change
> with lid position. xfce-power-manager debug does not notice the lid change
> though it does backlight changes, and keyboard based suspends...
> 
> toggling between elogind lid switch settings seems to make no difference.

Thanks. Yes it seems as if it is the same issue.

I don't have hardware to test on, however when I was given temporary access  to
some I found that

returned true. And setting it to false with

fixed the issue.

However, Michaela said that didn't make any difference for her.

Can you try?

Thanks.

Mark

---

From: Mark Hindley <[email-masked]>
Date: Thu, 18 Jun 2020 09:55:40 +0100

On Wed, Jun 17, 2020 at 12:05:02PM -0500, POD wrote:
>    Hi Mark,
>    Did fresh install, toggling logind-handle-lid-switch to false does
>    produce the correct suspend action.
>    Previously was upgraded from ASCII

That is really useful information, thanks.

Michaela,

This confirms that the fix I suggested does work. However, in your case I
believe you upgraded from ascii.

Could you check the version of upower you have installed? You need to manually
upgrade it from ascii to beowulf as documented in the Upgrade Notes[1].

ascii upower version is 1:0.9.23-2+devuan1.3 whereas beowulf has 0.99.10-1. This
looks like a downgrade to apt because of the loss of the epoch ('1:'). However,
it is really an upgrade (compare the rest of the version). Also see bug #394[2]
Something like

 apt-get install --allow-downgrades upower/beowulf gir1.2-upowerglib/beowulf

should achieve what you need.

Does having the correct beowulf version of upower allow setting
logind-handle-lid-switch to false to restore the behaviour you expect?

Thanks

Mark

[1]  https://devuan.org/os/documentation/dev1fanboy/en/upgrade-to-beowulf
[2]  https://bugs.devuan.org/394

---

From: "Devuan bug Tracking System" <[email-masked]>
Date: Tue, 14 Feb 2023 09:20:04 +0000

This is an automatic notification regarding your bug report
which was filed against the xcfe4-power-manager package:

#479: xcfe4-power-manager: Can't configure laptop lid

It has been closed by Mark Hindley <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Mark Hindley <[email-masked]> by
replying to this email.

-- 
479: https://bugs.devuan.org/cgi/bugreport.cgi?bug=479
Devuan Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#479: xcfe4-power-manager: Can't configure laptop lid
From: Mark Hindley <[email-masked]>
To: [email-masked]
Cc: POD <[email-masked]>, Michaela Merz <[email-masked]>
Date: Tue, 14 Feb 2023 09:18:09 +0000

Closing as fixed: install correct upower versions and configure
logind-handle-lid-switch.

Mark

Subject: xcfe4-power-manager: Can't configure laptop lid
From: Michaela Merz <[email-masked]>
To: [email-masked]
Date: Tue, 2 Jun 2020 18:25:09 -0500

This worked in ASCII