Skip to content
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

applet incorrectly continues after a manual suspension #2

Open
fossfreedom opened this issue Nov 19, 2017 · 2 comments
Open

applet incorrectly continues after a manual suspension #2

fossfreedom opened this issue Nov 19, 2017 · 2 comments

Comments

@fossfreedom
Copy link

fossfreedom commented Nov 19, 2017

If the user initiates a suspension whilst the applet is running, after coming out of suspension the timer continues to work and then will initiate a second shutdown/suspension etc.

Kind of confusing.

Suggestion - disable suspension whilst running.

i.e. if the applet is running, read & store /org/gnome/settings-daemon/plugins/power/sleep-inactive-ac-type, temporarily set it to nothing

EDIT: similar key for on battery of a laptop on battery, the key is (of course) /org/gnome/settings-daemon/plugins/power/sleep-inactive-battery-type - both should be set to nothing.

Then reset to what was previously set afterwards when the applet ended its job but before initiating shutdown/suspension etc.

@gkr09
Copy link
Owner

gkr09 commented Sep 18, 2018

Hey @fossfreedom , Sorry for taking so long.
I tried your suggestion, but it only applies for suspend after timeout. It doesn't work when user manually suspends or hibernates.
What works is using systemd to prevent suspend & hibernate. But that requires asking user to authenticate everytime suspend/hibernate is scheduled and also to reset the above changes.
I am open to suggestions so, please help if you can !

@fossfreedom
Copy link
Author

fossfreedom commented Sep 18, 2018

just a suggestion - calculate the absolute time to complete e.g. 23:50hrs 2018/09/18 when the shutdown applet capability is initiated - then within the timer loop look at what the current time is compared with the "estimated time to complete" - if it is - for example 10 seconds or more later then the estimated completion time & date the user must have been through a suspension process. You can quit the timing loop at that point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants