gemian / repowerd

Repowerd - build 'master' on stretch and 'buster' on buster
0 stars 2 forks source link

repowerd under xmonad not working #1

Open feuerball11 opened 6 years ago

feuerball11 commented 6 years ago

Hi, I#m trying to get repowerd to work under xmonad. i started repowerd with systemctl start repowerd and set an behavior with repower-cli settings lid suspend battery

But even with that, my display stays on, and no suspension. What am i doing wrong here?

adamboardman commented 6 years ago

I've not used the cli part, it just came along with the branching, its certainly not something you need to make use of to replicate sleeping as per lxqt gemian.

The crucial thing you need to know about the gemini is that its keyboard gets squashed (including the 'on/esc') button so this has to be blocked/eaten (I failed to get useful information from Planet as to how this is handled in Android - beyond the keyboard driver having a bit where it ignores the pressing of many keys and turns off with the screen), secondly repowerd came from ubports land so it knows nothing of x screen savers.

With that in mind you'll understand why the current gemian sleep proces involves xss-lock to to launch gemian-lock after a time out, and gemian-lock to indicate its presence, permit sleeping and eat stray keypresses (including ignoring esc when shut). Its mostly a quick and nasty hack, with the plan to do something nice in the move to a more up to date display system. I'm fairly convinced there are bugs in this area and certainly on buster it reboots when closed far more frequently.

feuerball11 commented 6 years ago

Thanks. I'll try to reproduce the sleep process given with your link (wasnt able to find that for some reason) .. On another look-over there is a lot on that site i can make use of. Thanks for the explanation. If i can get everything to work, i'll post my solution in here, and close the issue.

feuerball11 commented 6 years ago

Alright, so i installed everything, i started repowerd, and i run "xss-lock gemian-lock" manualy. But that doesent seem to work. What am i missing now? Sorry for that kind of questions, i'm still a noob when it goes to linux and how most of the things normaly work.

adamboardman commented 6 years ago

You either wait for the xss-lock to timeout (about 6mins), or you close the device?

feuerball11 commented 6 years ago

Maybe that wasnt clear enough, but i closed the device and nothing happend. that was what i meant by "but that doesent work" my main goal is still to get display-off/suspend/sleep/lock whatever, work with lid close.

adamboardman commented 6 years ago

Yea I had no clue what your expectation was, nor do I know anything about xmonad. I guess you'll need to debug it to track it down, you can get a screen off now with: xset dpms force off

feuerball11 commented 6 years ago

Alright sorry, my bad. The xset command clearly helps. is there a way to execute commands on lid close? so i culd just hack the xset dpms command into the lid close, and all would be fine. Beside that, having the timeout running, and having a option to manualy lock is a great start. Thanks for that. What i dont get is: shouldnd repowerd get the lid close, and trigger that "xset dpms force off" by itself, or is xmonad the part that need to react on something? I thought repowerd and xss-lock gemian-lock would work alone for this, and i just need to start them. Or am i completly wrong here? K/R Ignatz

adamboardman commented 6 years ago

Have a look at this area of the code: https://github.com/gemian/repowerd/blob/master/src/adapters/x11_display.cpp#L114

As I said you'll need to debug what's stopping this working in your particular case. I'd assume you've changed some other config (-cli-fiddling?) that's stopping it from working.

wrobell commented 5 years ago

I can confirm the issue with repowerd when using xmonad. Looking at the logs, repowerd detects the lid is closed or opened. Unfortunately, for some reason the screen does not switch off at all - this is even if you close lid not fully (to avoid the keys being pressed, but repowerd to detect the event).

IMHO, this is not related to xmonad itself. We start quite basic X session and I suspect appropriate DBus activation or policy kit agent or systemd login related issue needs to be solved here.

wrobell commented 5 years ago

I have noticed the following

  1. After starting Gemini PDA, login into XMonad session - lid closing does not trigger blank screen.
  2. Login as gemini user into LXQt session, logout and login into XMonad session - lid closing works.
  3. Logout and login as any other user into XMonad session - lid closing works as well.

It seems like getting into LXQt session enables something, which makes lid closing work.

ericsfraga commented 5 years ago

I've been revisiting this issue as it also arises when using, for instance, stumpwm. If I want the lid action to be taken into account, I also have to log in with lxqt first. If I don't, nothing happens when I close or open the lid (although the "upower --monitor-detail" output shows that upower is seeing the lid close and open). What magic is lxqt doing to enable the action on lid activity? Can we not replicate this in other window managers, even if it is via shell commands in .xsessionrc, say?

adamboardman commented 4 years ago

The lid close -> to power save functions are configured to work with repowered+gemian-lock, I suspect the thing your missing is a 'xss-lock gemian-lock' from the other sessions. The reason for the changes in gemian-lock is to help with eating any stray keys whilst the device is closed.