stretchly icon indicating copy to clipboard operation
stretchly copied to clipboard

[Bug]: Stretchly prevents system sleep on Debian with Gnome

Open tzugen opened this issue 3 years ago • 12 comments

Version

  • [X] I'm using version 1.6.0

Known issues

  • [X] I've checked Known issues

Existing issues

  • [X] I've checked Existing issues

What operating system are you using?

Linux

Operating System Version

Debian

Reproduction steps

  1. Let the computer be idle

Expected Behavior

Computer sleeps

Actual Behavior

Computer doenst sleep while stretchly is running.

Relevant log output

No response

Preferences

No response

Additional information

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

tzugen avatar Apr 23 '21 16:04 tzugen

Interesting, I don't even know where to look. I have Debian with KDE. Could you please make a screenshot of your "Sleep" settings?

hovancik avatar Apr 24 '21 17:04 hovancik

I believe it is the notifications. Just a minute ago my laptop had its screen off, and suddenly it went on, on the bottom displayed an information about a new notification from Stretchly.

tzugen avatar Apr 27 '21 19:04 tzugen

Bildschirmfoto von 2021-04-27 21-48-58 cleaned Bildschirmfoto von 2021-04-27 21-49-04 cleaned

tzugen avatar Apr 27 '21 19:04 tzugen

Maybe try disabling notifications in Preferences -> Schedule?

What is your break schedule setup?

hovancik avatar Apr 28 '21 09:04 hovancik

I'm trying your settings on my work ubuntu with gnome but all seems good, system went to sleep

hovancik avatar Apr 28 '21 10:04 hovancik

I will investigate more, when I am back at that laptop!

tzugen avatar May 01 '21 10:05 tzugen

I just had the time to test.

  • There was no other app running
  • I set the sleep timer to 700 seconds using dconf-editor

Without Stretchly: Sleep after 700 seconds With Stretchly: No Sleep. It didn't matter if I had notifications enabled.

Also the "natural break" detection doesn't seem to work, when I came back stretchly started a large break immidiately after.

Do you know if there is a log, about what keeps the system awake?

tzugen avatar May 18 '21 07:05 tzugen

Do you know if there is a log, about what keeps the system awake?

No idea, never heard about it and could not google anything.

Could also paste the logs from your test here? Preferences -> About -> Ctrl+D -> logsFile

hovancik avatar May 18 '21 11:05 hovancik

You need to find the inhibitors, a.k.a. which processes are preventing your suspend:

systemd-inhibit --list --mode=block That will list the processes which do not "want to sleep"

says stackexchange. Will try it later and also send the log

18.05.2021 13:40:21 Jan Hovancik @.***>:

Do you know if there is a log, about what keeps the system awake?

No idea, never heard about it and could not google anything.

Could also paste the logs from your test here? Preferences -> About -> Ctrl+D -> logsFile

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub[https://github.com/hovancik/stretchly/issues/931#issuecomment-843095301], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AQEZOY4ZCU6EJKQXPNQ2FDDTOJGZ5ANCNFSM43O5LZVA]. [data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD8AAAA/CAYAAABXXxDfAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAAmSURBVGiB7cEBDQAAAMKg909tDwcUAAAAAAAAAAAAAAAAAAAAJwY+QwABivJx1AAAAABJRU5ErkJggg==###24x24:true###][Verfolgungsbild][https://github.com/notifications/beacon/AQEZOY4QWONZ5TFNMPB3AG3TOJGZ5A5CNFSM43O5LZVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGJAJ2BI.gif]

tzugen avatar May 18 '21 13:05 tzugen

Here's what I get:

➜  ~ systemd-inhibit --list --mode=block
WHO        UID  USER  PID  COMM            WHAT                                                                       WHY                      MODE
PowerDevil 1000 conta 1328 org_kde_powerde handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch KDE handles power events block

1 inhibitors listed.

hovancik avatar May 22 '21 18:05 hovancik

I started stretchly at 11:10 and then let the laptop sit idle:

[2021-05-23 11:10:11.884] [info]  Stretchly: initializing...
[2021-05-23 11:10:11.897] [info]  Stretchly: loading preferences
[2021-05-23 11:10:11.906] [info]  Stretchly: starting Idle time monitoring
[2021-05-23 11:10:11.906] [info]  Stretchly: starting Do Not Disturb monitoring
[2021-05-23 11:20:12.194] [info]  Stretchly: showing window 1 of 1
[2021-05-23 11:20:12.197] [info]  Stretchly: starting Mini Break
[2021-05-23 11:20:42.201] [info]  Stretchly: finishing Mini Break
[2021-05-23 11:30:42.472] [info]  Stretchly: showing window 1 of 1
[2021-05-23 11:30:42.475] [info]  Stretchly: starting Mini Break
[2021-05-23 11:31:12.479] [info]  Stretchly: finishing Mini Break
[2021-05-23 11:41:12.756] [info]  Stretchly: showing window 1 of 1
[2021-05-23 11:41:12.758] [info]  Stretchly: starting Mini Break
[2021-05-23 11:43:00.385] [info]  System: suspend or lock
[2021-05-23 11:43:00.388] [info]  Stretchly: finishing Long Break
[2021-05-23 11:43:00.396] [info]  Stretchly: pausing breaks for 1
[2021-05-23 11:47:26.113] [info]  System: resume or unlock
[2021-05-23 11:47:26.116] [info]  Stretchly: resuming breaks

Interestingly it managed to sleep after 30 minutes.

Systemd also doesnt list anything out of order:


WHO UID  USER PID  COMM           WHAT                                                     WHY                       MODE
xxx 1000 xxx  2456 gsd-media-keys handle-power-key:handle-suspend-key:handle-hibernate-key GNOME handling keypresses block

1 inhibitors listed.

tzugen avatar May 23 '21 09:05 tzugen

Interesting then, not sure. Might be worth trying to see what systemD will show when system seems not to go to sleep. I found that there is some API in electron to disable sleep but I am not using it.

hovancik avatar Jun 03 '21 07:06 hovancik

Hi, I have similar issue and I don't think it's only related to system sleep. In my case, if there is no activity for 10m, monitor should be turned off (no sleep, just screen/monitor).

Stretchly notifications are kind of "sticky". When it appears (eg. "Mini break in 10 sec") it will stay on the screen until there is any kind of user-input activity - moving a mouse, click on keyboard - only then it disappears.

But when there is no activity (which is eg. when I'm not in front of my laptop), notification stays visible on the screen and that is probably what causes that system doesnt go sleep or monitor doesn't turn off cause the system sees that notification as some kind of activity that it prevents it from going forward with sleep/screen off.

Summary: I don't think it's related to sleep/systemd, but it's related to stretchly notifications not disappearing when there is no user-input activity.

This is GNOME on Fedora, so my another assumption is that is related to sth in GNOME notification system which works someway differently than in KDE.

ekasprzak avatar Mar 17 '23 18:03 ekasprzak

@ekasprzak could you try disabling pre break notifications and see what happens? It's in Schedule tab.

hovancik avatar Mar 18 '23 13:03 hovancik

@hovancik yes, I meant those notifications exactly, I was pretty sure that those are the issue (not the notification itself, but its "stickiness" in GNOME), but I waited to actually test it and yes, I can confirm that at least in my case it makes screen/monitor auto off work.

@tzugen I know it's been some time, but if you're still using Stretchly, maybe you could check if this solves your problem with system sleep (then, we would be sure that it's the sticky notification, not Stretchly itself issue) ?

As a summary - I don't consider it as solved, cause I really like this pre break notification", so I have at least a short moment to finish/pause what I was doing and prepare for a break (instead of immediately click on skip when I'm in the middle of sth and there is no pre break notification).

ekasprzak avatar Mar 19 '23 11:03 ekasprzak

@ekasprzak can you try running Stretchly from source, specifically PR linked above? I think it should fix it.

hovancik avatar Apr 06 '23 09:04 hovancik

@ekasprzak can you try running Stretchly from source, specifically PR linked above? I think it should fix it.

Yes, it does! Notification disappears by itself, doesn't prevent screen going off, which was my main issue. But, because I kind of stole this issue (preventing sleeping) because I was pretty sure it's connected so tested that too, enabled system auto sleep and this also worked after inactivity time)

So, all good (Fedora 37 Workstation/GNOME), thanks a lot @hovancik!

ekasprzak avatar Apr 11 '23 14:04 ekasprzak