ifl0w / RandomWallpaperGnome3

Random Wallpapers for Gnome 3
MIT License
176 stars 41 forks source link

Auto-Fetching not working #201

Closed ayusc closed 4 months ago

ayusc commented 5 months ago

Auto-Fetching is not working. I am using Zorin OS 17.1 (Gnome 43.9). Wallpaper sources is set to Unsplash and "only featured images" option is turned on (and custom height width is used according to my screen resolution). Auto-Fetching time is set to 1 minutes and fetch on startup is enabled. However under General > Request new wallpaper works fine and the wallpaper changes. Ask me if you need logs of some kind.

Lucki commented 5 months ago

See if something related pops up with journalctl -f.

ayusc commented 5 months ago

I am getting this error message in journalctl -f whenever i request a new wallpaper but waiting for any other error messages i couldnt find anything related.

Apr 16 18:12:32 ayus-laptop gnome-shell[1156]: RWG3 [ERROR] >> WallpaperController :: Could not load new wallpaper: Gio.IOErrorEnum: Error removing file /home/ayus/.cache/randomwallpaper@iflow.space/wallpapers/1713206799038_photo-1516628368662-4220aaf9339d: No such file or directory

Also while opening the extension settings i am getting this:

Apr 16 18:37:31 ayus-laptop gjs[5039]: JS WARNING: [/home/ayus/.local/share/gnome-shell/extensions/randomwallpaper@iflow.space/soupBowl.js 7]: Requiring Soup but it has 2 versions available; use imports.gi.versions to pick one

Edit: The previous error is gone after i clicked on clear history from extension settings.

Lucki commented 5 months ago

And it's still not auto-fetching?

I don't remember if the old version had a log level selection, if it has, turn it up to "debug" and look into the journal again while it should auto-fetch.

ayusc commented 5 months ago

@Lucki I cloned the repository and tried to build it with the given instructions but i am getting the following error:

ayus@ayus-laptop:~/RandomWallpaperGnome3$ ./build.sh && ./install.sh
+ [[ 1000 -eq 0 ]]
+++ dirname -- ./build.sh
++ cd -- .
++ pwd
+ SCRIPTDIR=/home/ayus/RandomWallpaperGnome3
+ SRCDIR=/home/ayus/RandomWallpaperGnome3/src
+ DESTDIR=/home/ayus/RandomWallpaperGnome3/randomwallpaper@iflow.space
+ cd /home/ayus/RandomWallpaperGnome3
+ '[' 0 -eq 0 ']'
+ setup_environment
+ check_command npm
+ command -v npm
+ npm install
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@es-joy/jsdoccomment@0.40.1',
npm WARN EBADENGINE   required: { node: '>=16' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/eslint-plugin@6.3.0',
npm WARN EBADENGINE   required: { node: '^16.0.0 || >=18.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/parser@6.3.0',
npm WARN EBADENGINE   required: { node: '^16.0.0 || >=18.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/scope-manager@6.3.0',
npm WARN EBADENGINE   required: { node: '^16.0.0 || >=18.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/type-utils@6.3.0',
npm WARN EBADENGINE   required: { node: '^16.0.0 || >=18.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/types@6.3.0',
npm WARN EBADENGINE   required: { node: '^16.0.0 || >=18.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/typescript-estree@6.3.0',
npm WARN EBADENGINE   required: { node: '^16.0.0 || >=18.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/utils@6.3.0',
npm WARN EBADENGINE   required: { node: '^16.0.0 || >=18.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/visitor-keys@6.3.0',
npm WARN EBADENGINE   required: { node: '^16.0.0 || >=18.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'are-docs-informative@0.0.2',
npm WARN EBADENGINE   required: { node: '>=14' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'eslint-plugin-jsdoc@46.4.6',
npm WARN EBADENGINE   required: { node: '>=16' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'ts-api-utils@1.0.1',
npm WARN EBADENGINE   required: { node: '>=16.13.0' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'typescript@5.1.6',
npm WARN EBADENGINE   required: { node: '>=14.17' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }

added 173 packages, and audited 174 packages in 15s

35 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
+ rm -r '/home/ayus/RandomWallpaperGnome3/randomwallpaper@iflow.space/*'
+ true
+ compile_ui
+ check_command blueprint-compiler
+ command -v blueprint-compiler
+ blueprint-compiler batch-compile /home/ayus/RandomWallpaperGnome3/randomwallpaper@iflow.space/ui /home/ayus/RandomWallpaperGnome3/src/ui /home/ayus/RandomWallpaperGnome3/src/ui/genericJson.blp /home/ayus/RandomWallpaperGnome3/src/ui/localFolder.blp /home/ayus/RandomWallpaperGnome3/src/ui/pageGeneral.blp /home/ayus/RandomWallpaperGnome3/src/ui/pageSources.blp /home/ayus/RandomWallpaperGnome3/src/ui/reddit.blp /home/ayus/RandomWallpaperGnome3/src/ui/sourceConfigModal.blp /home/ayus/RandomWallpaperGnome3/src/ui/sourceRow.blp /home/ayus/RandomWallpaperGnome3/src/ui/unsplash.blp /home/ayus/RandomWallpaperGnome3/src/ui/urlSource.blp /home/ayus/RandomWallpaperGnome3/src/ui/wallhaven.blp
error: Could not determine what kind of syntax is meant here
at /home/ayus/RandomWallpaperGnome3/src/ui/genericJson.blp line 4 column 10:
   4 |template $GenericJsonSettings: Adw.PreferencesPage {
     |         ^

ayus@ayus-laptop:~/RandomWallpaperGnome3$ git branch
* develop

I have installed blueprint-compiler and npm beforehand with sudo apt install I need to compile this to use the debugging as described here

Lucki commented 5 months ago

You're mixing things here. You're using the old version with Gnome < 44 (RWG < 3) while trying to build the new version (RWG >= 3).

So this would be the right place for the version you're actually using https://github.com/ifl0w/RandomWallpaperGnome3/tree/v2.7.4 - that one doesn't require npm or blueprint-compiler. The debug.sh is just a wrapper around journalctl: https://github.com/ifl0w/RandomWallpaperGnome3/blob/v2.7.4/debug.sh

And for completion: It seems your npm and blueprint-compiler are too old, so you can't easily build RWG >= 3 - it wouldn't run anyway, because it requires Gnome >= 44.


Maybe I was misleading, I asked to set the log level in the extensions settings to debug, if there is one.


Another thing we can check if you have dconf installed:

dconf read /org/gnome/shell/extensions/space-iflow-randomwallpaper/timer-last-trigger

Is the output a high number and does it change, when a new automatic wallpaper should have been downloaded?

If you don't have dconf we can also use gsettings directly, but that command is slightly more complicated.

ifl0w commented 5 months ago

@ayusc Was that feature working for you before, or did it never work?

Regarding the second log you found: this is probably not important as it is only a warning. Since manually loading a new wallpaper is working, it confirms that this isn't critical here.

Could you try to set the interval to something larger than 1 minute (e.g., 5 minutes) and then disable and enable auto fetching? IIRC, this should also reset the timer-last-trigger value.


@Lucki Thanks for helping out here already!

Maybe I was misleading, I asked to set the log level in the extensions settings to debug, if there is one.

Back then, there was no UI option to do this.

ayusc commented 5 months ago

@ifl0w No this feature wasn't working for me before and it never worked. I did it as you said i changed the timer to 3 mins and disable and enable auto fetching but it didn't helped. Note that when i do so at that instant it downloads 5 wallpapers and sets them one by one and stops at the last one. But if i clear the history i can see no new wallpapers are getting downloaded. I waited for more than 3 minutes nothing happened. However as i said earlier if i click on new wallpaper it downloads and sets the wallpapers almost immediately and i can see the downloaded wallpaper in the recents (in the extension icon)

Edit: The fetch on startup options works fine it sets a new wallpaper on reboot but after that no new wallpapers are downloaded.

ayusc commented 5 months ago

Another thing we can check if you have dconf installed:

dconf read /org/gnome/shell/extensions/space-iflow-randomwallpaper/timer-last-trigger

Is the output a high number and does it change, when a new automatic wallpaper should have been downloaded?

If you don't have dconf we can also use gsettings directly, but that command is slightly more complicated.

I checked it (after clearing the history) and requesting new wallpaper. The values change as you can see.

ayus@ayus-laptop:~$ dconf read /org/gnome/shell/extensions/space-iflow-randomwallpaper/timer-last-trigger
int64 0
ayus@ayus-laptop:~$ dconf read /org/gnome/shell/extensions/space-iflow-randomwallpaper/timer-last-trigger
int64 1713415726558
ayus@ayus-laptop:~$ dconf read /org/gnome/shell/extensions/space-iflow-randomwallpaper/timer-last-trigger
int64 1713415726558
Lucki commented 5 months ago

It looks suspicious that the timer gets activated (changed from 0 to 1713415726558) but then doesn't change again. And that they're all fetched at once is also strange as it implies that the timer generally works.

That is a laptop, is it in some sort of energy saving mode?


If you're feeling adventurous you could try to raise the priority in ~/.local/share/gnome-shell/extensions/randomwallpaper@iflow.space/timer.js in line 90. After changing you have to log out and back in to reload the extension.

        // actual timer function
-       this._timeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, millisRemaining, () => {
+       this._timeout = GLib.timeout_add(GLib.PRIORITY_HIGH, millisRemaining, () => {
            if (this._timoutEndCallback) {
                this._timoutEndCallback();
            }

            this.reset(); // reset timer
            this.start(); // restart timer
        });

https://github.com/ifl0w/RandomWallpaperGnome3/blob/ed1dddf47fd831d9106a0c1f7c61d82fa5f78475/randomwallpaper%40iflow.space/timer.js#L90

ayusc commented 5 months ago

It looks suspicious that the timer gets activated (changed from 0 to 1713415726558) but then doesn't change again. And that they're all fetched at once is also strange as it implies that the timer generally works.

That is a laptop, is it in some sort of energy saving mode?

I am extremely sorry the value does change everytime by mistake by copied the same line twice from terminal. But it never changes on its own unless i manually request new wallpaper. Also it changes on boot (as i said the fetch on startup works fine)

Yes this is a laptop. No it's not in energy saving mode. I only have two options under power namely balanced and power saving in my operating system, as you can see. Also i forgot to mention that the wallpaper changes twice on startup. It is supposed to change only once.

If you're feeling adventurous you could try to raise the priority in ~/.local/share/gnome-shell/extensions/randomwallpaper@iflow.space/timer.js in line 90. After changing you have to log out and back in to reload the extension.

I did this but the issue still persists. I also tried wallhaven source with my api key same problem manual fetching works but auto-fetching doesn't. Screenshot from 2024-04-20 08-32-05

Lucki commented 5 months ago

Sorry, I can't think of any way the timer would fire in quick succession. The next timer only gets set up when the previous timer already has placed a new wallpaper - with the waiting time :thinking:


Also i forgot to mention that the wallpaper changes twice on startup. It is supposed to change only once.

This is because the timer surpassed the interval and fetched a wallpaper while also the "fetch on startup"-setting requested one. That bug is fixed in version >= 3.0.0

ayusc commented 5 months ago

@Lucki I really don't know whats going on. I made a small screen recording. Please have a look at it. I really want this to work. It's a very nice extension.

I am using the latest version of the extension from the extensions site. How come that bug is still there.

Edit: I just tried out another extension named Bing Wallpaper and it working fine for me. But still i would love to use this one, as it has mutiple options.

Screencast from 2024-04-21 07-18-08.webm Screenshot from 2024-04-21 07-27-51

ayusc commented 5 months ago

Please respond someone.

ifl0w commented 5 months ago

Please respond someone.

Hey @ayusc! I just tested the extension on a ZorinOS 17.1 VM, and it seems that the "fetch on startup" feature breaks the auto-fetch timer. I didn't really debug it, but you can disable the fetch on startup in the settings, log out, and then log in again. After doing that, the timer works again for me. Can you give this a try?

Note that I don't really support older Gnome versions and don't test multiple operating systems, because doing so would require a lot more time and effort. I hope it is understandable that this issue doesn't have a high priority, especially since Ubuntu 24.04 now comes with Gnome 46 and moving forward with the 3.0.0 version seems more important.

ayusc commented 4 months ago

@ifl0w Thanks for responding. It works finally upon disabling the fetch on startup option.