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

Wrong image on a desktop #594

Open
Meelee35 opened this issue Jun 28, 2024 · 7 comments
Open

Wrong image on a desktop #594

Meelee35 opened this issue Jun 28, 2024 · 7 comments
Labels
bug Something isn't working priority-high
Milestone

Comments

@Meelee35
Copy link

Meelee35 commented Jun 28, 2024

  • WDD Version: 5.5.0
  • OS Version: Win11 (Version 10.0.22631 Build 22631)

Steps to Reproduce:

  1. Start windynamicdesktop
  2. Press on the desktop icon in taskbar, switch to desktop 2.
  3. See that the desktop background is the correct image, then fades to either the wrong time or your original desktop background.

Are you using the Microsoft Store version of WDD?: Yes/No
No

Desktop 1 displays the correct image for the time of day.
image
Desktop 2 is stuck on image it was when i last refreshed from the WDD menu on that desktop.
image

May i also add that using the sync desktop wallpaper script does not work, scripts are enabled.

@t1m0thyj
Copy link
Owner

t1m0thyj commented Jul 27, 2024

@Meelee35 Thanks for reporting this!

I've just pushed an update to the SyncVirtualDesktops script that fixes an error it could throw about the Nuget package provider failing to install: https://github.com/t1m0thyj/WDD-scripts/blob/master/experimental/SyncVirtualDesktops.ps1

With the latest version of the script, changing the wallpaper across multiple desktops is working fine for me. Could you try installing the updated script and switching between 2 different themes with it enabled? The behavior I'm seeing is that the wallpaper changes on both Desktop 1 and 2.

@treispezeronoua
Copy link

Hi! I'm using the latest version of WDD, downloaded from GitHub, along with the SyncVirtualDesktops.ps1 script.

The wallpaper doesn't update automatically on the second etc virtual desktop. Tried different themes, no luck.
I'm using Windows 11 22H2, build 22621.3880.

@t1m0thyj
Copy link
Owner

t1m0thyj commented Aug 6, 2024

After creating multiple virtual desktops, could you try running the following command in a PowerShell terminal and let me know what happens? This is the same method used by the SyncVirtualDesktops.ps1 script. It should set the wallpaper across all virtual desktops to be the default Windows 11 Bloom wallpaper.

Get-DesktopList | ForEach-Object { Set-DesktopWallpaper -Desktop $_.Number -Path "C:\Windows\Web\Wallpaper\Windows\img0.jpg" }

@treispezeronoua
Copy link

treispezeronoua commented Aug 7, 2024

@t1m0thyj When running the above command from your comment I get the following:

Get-DesktopList : The 'Get-DesktopList' command was found in the module 'VirtualDesktop', but the module could not be
loaded. For more information, run 'Import-Module VirtualDesktop'.
At line:1 char:1

  • Get-DesktopList | ForEach-Object { Set-DesktopWallpaper -Desktop $_.N ...
  •   + CategoryInfo          : ObjectNotFound: (Get-DesktopList:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
    
    

Then, if I run 'Import-Module VirtualDesktop' in terminal, I get:

Import-Module : File
C:\Users\user\OneDrive\Documents\WindowsPowerShell\Modules\VirtualDesktop\1.5.1\VirtualDesktop.psm1 cannot be loaded
because running scripts is disabled on this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1

  • Import-Module VirtualDesktop
  •   + CategoryInfo          : SecurityError: (:) [Import-Module], PSSecurityException
      + FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand
    
    

Lastly, by running the 'Get-ExecutionPolicy -List' command, I get:

Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process Undefined
CurrentUser Undefined
LocalMachine Undefined

If I change the execution policy to allow running scripts, by running the initial command from your comment I get the following:

The type initializer for 'VirtualDesktop.DesktopManager' threw an exception.
At C:\Users\user\OneDrive\Documents\WindowsPowerShell\Modules\VirtualDesktop\1.5.1\VirtualDesktop.ps1:1070 char:16

  •     for ($I = 0; $I -lt [VirtualDesktop.Desktop]::Count; $I++)
    
  •                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (:) [], TypeInitializationException
    • FullyQualifiedErrorId : System.TypeInitializationException

@t1m0thyj
Copy link
Owner

t1m0thyj commented Aug 7, 2024

@treispezeronoua Thanks for the detailed response! Based on the error message, you have v1.5.1 of the PS VirtualDesktop module installed. This version is 2 years old and doesn't support recent builds of Win11.

If you have the latest version of SyncVirtualDesktops.ps1, it's supposed to detect when Windows has been updated to a new build and automatically update the VirtualDesktop module for you, but this may not be working as intended. In the "scripts" folder alongside SyncVirtualDesktop.ps1 there should be another file named "SyncVirtualDesktops.dat". Could you please attach the contents of this file if exists?

For now manually updating the VirtualDesktop module should fix the problem. In a PowerShell terminal that allows running scripts, run this command to update to the latest version v1.5.8: Update-Module -Name VirtualDesktop. After the update is successful, the SyncVirtualDesktops.ps1 script should work in WinDD.

@treispezeronoua
Copy link

@t1m0thyj Thank you for your reply!

I couldn't find the .dat file in the scripts folder, but I managed to get the WDD to sync the wallpaper across virtual desktops.

To do that, I deleted VirtualDesktop v1.5.1 and reinstalled it using the 'Install-Module VirtualDesktop' command, which installed v1.5.8.
Once the VirtualDesktop module was installed, I then set the Execution Policy to Unrestricted using the 'Set-ExecutionPolicy -ExecutionPolicy Unrestricted' command.

Finally, to test that everything was working as expected, I ran your command, 'Get-DesktopList | ForEach-Object { Set-DesktopWallpaper -Desktop $_.Number -Path "C:\Windows\Web\Wallpaper\Windows\img0.jpg" }'.

Thank you for helping me with this!

@t1m0thyj
Copy link
Owner

@Meelee35 Does the workaround mentioned in #594 (comment) work for you as well?

@t1m0thyj t1m0thyj added this to the Next Release milestone Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-high
Projects
None yet
Development

No branches or pull requests

3 participants