2 2
dahni

Pinebook, Armbian Installed: Suspend on Lid Close?

Recommended Posts

i'm trying to make suspend on lid close work.
i saw in this thread that some people are aware that there's a problem.

 

i'd prefer to achieve this from within xfce4-power-manager.

 

here's the thing:

 

1. using the normal xfce desktop


     * for "when laptop lid is closed", only 'lock screen' and 'switch off diplay' are available
     * "System sleep mode" is completely grayed out, as well as security 'lock screen when system is going to sleep'
     * the 'Ask' option is available only for "Buttons". Choosing it, then choosing "Suspend" from the dialog, causes the ui to hang (desktop darkened), but after a minute i can 'escape' out of it.
     * 'systemctl suspend' suspends as expected (without locking the screen)

 

2. using plain openbox without display manager (i.e. console login & startx instead of nodm) or desktop environment, xfce4-power-manager autostarted


     * for "when laptop lid is closed", 'lock screen', 'switch off diplay', 'suspend' and 'hibernate' are available, but only the first 2 work
     * "System sleep mode" gives me a choice between 'suspend' and 'hibernate' - only suspend works (!) as expected.
     * security 'lock screen when system is going to sleep' is not greyed out, and un/checking it works as advertised
     * the 'Ask' option is available only for "Buttons". It does nothing.
     * 'systemctl suspend' suspends as expected (without locking the screen)

in other words, choice nr. 2. works in all aspects except the lid switch!
 

i tried to let systemd handle the lid switch - to no avail.

i also tried to not use xfce4-power-manager at all, only systemd - to no avail.

 

reading `man logind.conf` i notice this:

 

Quote

  HandleLidSwitch=..... Only input devices with the "power-switch" udev tag will be watched for key/lid switch events.

 

Interesting...

 

'udevadm monitor' showed nothing for opening/closing the lid.

 

dmesg showed this:

 

    hall: (D) hall_isr   

    hall: (I) HALL_CLOSE

    hall: (D) hall_isr   

    hall: (I) HALL_OPEN

 

every time i open/close the lid...

 

so, where exactly would i have to add this "power-switch" udev tag?

 

phew, my head swims... 

 

any ideas? maybe a secret solution already exists?

Share this post


Link to post
Share on other sites

Works fine for me using an armbian build with mate installed on top. I didn't have to do anything to make it work. One thing that does catch me out is the machine powers up when you plug the dc in. I have to try and remember not just plug the connector in with the machine closed and suspended and wander off to bed.

Share this post


Link to post
Share on other sites
11 hours ago, dahni said:

interesting.

does it use "mate-power-manager"?

what does 'systemd-inhibit' say?

mate-power-manager is running, so I guess so.

 

systemd-inhibit seems to confirm that:

    What: handle-power-key:handle-suspend-key:handle-lid-switch
     Why: Mate power manager handles these events
    Mode: block

 

Share this post


Link to post
Share on other sites

mate-power-manager indeed works better in this respect.
i had to manually add screen locking via systemd though (not sure if installing mate-screensaver would have fixed that too).

one thing that doesn't work is automatic 'sleep' after a given amount of inactivity.
right now, it does nothing (just blanks the screen) unless i trigger the suspend with one of 3 configured methods (lid, power button, sleep button).

xfce4-power-manager let me define a "Sleep Action" - maybe there's something similar going on here, but no GUI dialog to set it?

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
2 2