You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've set the refresh timer to 24h, but this timer seems to be reset every time the screen is locked. After unlocking the screen, the timer will say "<1m" and refresh the image pretty soon after that.
Could it have something to do with that extensions are not allowed to run during the lock screen?
The text was updated successfully, but these errors were encountered:
PaulVanSchayck
changed the title
Refresh timer reset every time screen is locked
The refresh timer is being reset every time screen is locked
Nov 1, 2019
Indeed, I am seeing the same behaviour. I think it's a remnant of how the Bing wallpaper changer (which this is based on) is working – there there is one wallpaper per day and that's it, so even if the timer refreshes multiple times a day it won't change the wallpaper unless there is a new wallpaper available from Bing. So setting the timer to update every time the screen is unlocked makes sense, because that's essentially checking for a new available wallpaper.
What we need to do here is to remember when the wallpaper was last saved – I'm not sure how to do that, except writing it to a "temporary config file" or something. This also affects the description, author and license information in the widget – once you unlock the screen, that information doesn't show up in the widget like it should. So writing all of this to a config file would remedy that.
Now, for how to actually do that in JavaScript… I'll need to do some googling. :-)
See the utils.js file within your own extension for some help with this, you might need to extend the DConf schema for the extension.
this._settings = Utils.getSettings();
let timezone = GLib.TimeZone.new_local();
let localTime = GLib.DateTime.new_now(timezone).add_seconds(seconds);
this._settings.set_int('next-refresh',localTime.to_unix());
nextrefresh = this._settings.get_int('next-refresh');
The reason the time is being reset I believe is because the extension actually loses state when the screen is locked. I thnik they might actually be disabled when the screen locks, at least on some versions of GNOME.
Nice extension!
I've set the refresh timer to 24h, but this timer seems to be reset every time the screen is locked. After unlocking the screen, the timer will say "<1m" and refresh the image pretty soon after that.
Could it have something to do with that extensions are not allowed to run during the lock screen?
The text was updated successfully, but these errors were encountered: