-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration to Never suspen when plugged in have no effect #9
Comments
Looking at the code, I don't understand how we get to the suspend.... I'm trying to set the on battery suspend to never and see if that will prohibit the suspention... but that is also not very likely if I look at the code... but hey, it seems we are in the unlikely territory here... |
upower reports on-battery: no, so the battery setting shouldn't have any effect.... but we will see anyway... |
@ids1024 Looking at the code i notice that the initial state will have on_battery = false. In the case where I start my laptop on battery, will it get an OnBattery notification or how does that work? Note: Not relevant to my issue here really, since it would ensure that it uses the on ac settings... just something I noticed and got a bit confused about. |
Hey, @snaggen you do get events that change the value, see here: https://github.com/pop-os/cosmic-idle/blob/master/src/main.rs#L64-L67 , https://github.com/pop-os/cosmic-idle/blob/master/src/main.rs#L209-L211 |
I don't know since there aren't really any logs for those events from what I can see |
I have added some debug to clearly see what is happening, and also commented out the 'systemctl suspend' call. And I still get suspends. I have changed the timing of the screen blanking, and it seems that when ever the screen is fading to black the system also goes to suspend. This is not explicitly done by cosmic-idle. I can see that the code path is that it will correctly get a idle notification and run the
as expected. Still , the system goes to suspend. |
Yes, if the
Huh. So it doesn't suspend if you remove the If so, yeah, that's pretty odd. I guess it could be some firmware/driver weirdness. But I guess then Gnome would have the same issue? |
I will try to remove that line and see... but that will be tomorrow |
doesn't |
It is set on events. I just didn't know that you would get an on battery event when you initially connect to the upowerd. So, the code looked strange to me... |
Still, it is probably wrong the way it is because there are two different timeouts and the state of the machine whether it is on power or not should adhear to the different timeout, for example when you connect your laptop to AC you would want to suspend/blank the screen at a greater timeout than when on battery, but if you laptop was running on battery on startup that won't happen. And to be honest, when the on_battery changes that means that we had an interaction with the system so the notification timer should reset. |
If I remove the line above it doesn't go to suspend. Then it just fades to black, and go to the lock screen. So that line triggers something causing a suspend.
in the journalctl logs. It is the first suspend related log after the cosmic idle log line I have added. So it seems that it might be logind that reacts to something... not sure. This is a bit outside my expertise. |
Logind might suspend because another program has instructed it to. Or logind can do some things automatically, configured in |
I did check the /etc/systemd/logind.conf, but that is blank so it just uses default and then the idle action should be nothing. Also, it doesn't have its own timer (which would be the case if it was logind acting on its own), it reacts to the cosmic-idle dpms... so it is just weird. |
Just switched back to Gnome to test this, and there my laptop doesn't suspend when the screens are turned off. |
Using latest Fedora packages from copr (should be nightly built), and I have configured "Automatic suspend when plugged in: Never" in cosmic-settings. The laptop is still suspended. I don't know how long it did idle before it got suspended, since I wasn't in the room. But the journalctl clearly shows that it suspended:
The text was updated successfully, but these errors were encountered: