t1m0thyj / WDD-scripts

PowerShell scripts that add features to WinDynamicDesktop
87 stars 19 forks source link

Background change across multiple Virtual Desktops doesn't work (even with extra script installed) #30

Closed InfinitGit closed 1 year ago

InfinitGit commented 1 year ago

When you have multiple virtual desktops, it seems only the first one, or maybe the one active during the switch, gets the wallpaper changed. I was told to try installing the extra script for multiple virtual desktops (https://github.com/t1m0thyj/WDD-scripts/tree/master/experimental#synchronize-virtual-desktops), but it hasn't solved the issue, unfortunately.

The bug currently makes the app sort of unbearable as when you switch to a different virtual desktop it flashes to the wallpaper it is supposed to be for a split second, only to go back to the wrong (previous) wallpaper.

Is there another way around this or some update I missed? Probably one of the biggest bugs in the app, as everything else works swimmingly! Awesome app and hope this can be ironed out :)

bigplayer-ai commented 1 year ago

Totally agree with that one

On Thu, 9 Feb 2023 at 0:47 InfinitGit @.***> wrote:

When you have multiple virtual desktops, it seems only the first one, or maybe the one active during the switch, gets the wallpaper changed. I was told to try installing the extra script for multiple virtual desktops ( https://github.com/t1m0thyj/WDD-scripts/tree/master/experimental#synchronize-virtual-desktops), but it hasn't solved the issue, unfortunately.

The bug currently makes the app sort of unbearable as when you switch to a different virtual desktop it flashes to the wallpaper it is supposed to be for a split second, only to go back to the wrong (previous) wallpaper.

Is there another way around this or some update I missed? Probably one of the biggest bugs in the app, as everything else works swimmingly! Awesome app and hope this can be ironed out :)

— Reply to this email directly, view it on GitHub https://github.com/t1m0thyj/WDD-scripts/issues/30, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4MXGIZITXWHCJUFO3HR23TWWQO6NANCNFSM6AAAAAAUV2WQVQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Sent from Yazan’s iPhone

t1m0thyj commented 1 year ago

Hello, the reason for the Sync Virtual Desktops script being experimental is that unfortunately Microsoft has not yet stabilized the API for changing wallpapers on virtual desktops so code that attempts to do so keeps breaking with Windows 11 updates.

The module used by the PowerShell script appears to be no longer maintained as it has not worked since August: https://github.com/MScholtes/PSVirtualDesktop/issues/14#issuecomment-1221552707

I'll investigate using an alternative that may work with the latest version of Win11 such as https://github.com/Ciantic/VirtualDesktopAccessor

t1m0thyj commented 1 year ago

@InfinitGit @bigplayer-ai What version of Windows are you running?

I investigated this over the weekend, and the script works fine for me in Win11 22H2 (build 22621). It currently doesn't work in the Insiders Edition dev channel (build 25276) but a fix for this is in progress (see https://github.com/MScholtes/PSVirtualDesktop/pull/24).

bigplayer-ai commented 1 year ago

@InfinitGit @bigplayer-ai What version of Windows are you running?

I investigated this over the weekend, and the script works fine for me in Win11 22H2 (build 22621). It currently doesn't work in the Insiders Edition dev channel (build 25276) but a fix for this is in progress (see MScholtes/PSVirtualDesktop#24).

Windows 11 22H2 BUILD 22621.1265

t1m0thyj commented 1 year ago

I've just updated the SyncVirtualDesktops script so it will auto-update your VirtualDesktop PS1 module if an old version is installed. Please try the latest version to see if it fixes the issue: https://github.com/t1m0thyj/WDD-scripts/blob/master/experimental/SyncVirtualDesktops.ps1

bigplayer-ai commented 1 year ago

I've just updated the SyncVirtualDesktops script so it will auto-update your VirtualDesktop PS1 module if an old version is installed. Please try the latest version to see if it fixes the issue: https://github.com/t1m0thyj/WDD-scripts/blob/master/experimental/SyncVirtualDesktops.ps1

How does this work? Does it update my .ps1 file from yours github repo?

bigplayer-ai commented 1 year ago

I've just updated the SyncVirtualDesktops script so it will auto-update your VirtualDesktop PS1 module if an old version is installed. Please try the latest version to see if it fixes the issue: https://github.com/t1m0thyj/WDD-scripts/blob/master/experimental/SyncVirtualDesktops.ps1

I receive a new error that I never experienced and now it happens every time: Clip_20230220_171128

InfinitGit commented 1 year ago

@InfinitGit @bigplayer-ai What version of Windows are you running?

I investigated this over the weekend, and the script works fine for me in Win11 22H2 (build 22621). It currently doesn't work in the Insiders Edition dev channel (build 25276) but a fix for this is in progress (see MScholtes/PSVirtualDesktop#24).

image

Also, I added the new version of the file to the correct directory, but when I enable powershell commands it doesn't seem to find/recognize it ↓ image No error just doesn't seem to run 🫤 By the way, appreciate you figuring this out, for my use and many others this is essentially the only thing keeping this program from being perfect

t1m0thyj commented 1 year ago

@InfinitGit Can you attach a screenshot of your "scripts" folder in File Explorer? Mine looks like this: image

Yours should look similar except "SyncVirtualDesktops.dat" won't exist until the script runs successfully and creates it.

InfinitGit commented 1 year ago

image theres the directory ↑ and this is the contents of the file ↓ image

t1m0thyj commented 1 year ago

@InfinitGit File Explorer thinks the script is a "Text Document". This is probably because you have file extensions hidden and the filename actually ends in .ps1.txt. WinDD scripts must end in .ps1 to be detected, so try removing the extra .txt from the end, and see if that makes the script work.

InfinitGit commented 1 year ago

Ok just saved it correctly, and it found it to run. Will see whether it works in the morning when the background changes.

Thanks!

InfinitGit commented 1 year ago

I am happy to report I believe it is working as expected now! Thanks for your help Timothy and kudos for a great app!

t1m0thyj commented 1 year ago

How does this work? Does it update my .ps1 file from yours github repo?

@bigplayer-ai It is updating the PowerShell VirtualDesktop module that is used by the Sync Virtual Desktops script.

I receive a new error that I never experienced and now it happens every time

Not sure what's causing this error - typically the "type initialization exception" means the VirtualDesktop module is incompatible with your version of Windows, but build 22621 is a supported version (and the same one that I'm using).

A few things to try:

bigplayer-ai commented 1 year ago
  • Update-Module -Name VirtualDesktop -Force

This is what I get when running the "Update-Module -Name VirtualDesktop -Force":

 Update-Module -Name VirtualDesktop -Force
Cannot convert null to type "System.DateTime".
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7016 char:17
+                 $InstalledDate = $null
+                 ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : MetadataError: (:) [], ArgumentTransformationMetadataException
    + FullyQualifiedErrorId : RuntimeException

Clip_20230225_120623

t1m0thyj commented 1 year ago

@bigplayer-ai It looks like you're using an old version of PowerShell (v5). Please try installing the latest version of PowerShell (v7) from here - this should fix the $InstalledDate = $null error.

Or if you'd prefer to keep using the older version of PowerShell, try the workaround suggested here:

Comment line 7060 in PSModule.psm1 file by putting # at the beginning of this line and restart the PowerShell Console then run Get-InstalledModule cmdlet.

C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.1.3.1\PSModule.psm1:7060

# $InstalledDate = $nul
bigplayer-ai commented 1 year ago

Thanks this solved my issue.

bigplayer-ai commented 1 year ago

Now I receive this error: Clip_20230225_173507

pep-sanwer commented 9 months ago

@t1m0thyj apologies for commenting on a closed issue, but this is the closest I could find to my ask: Would it be possible to expose a CLI command to run the "Refresh Wallpaper" command in the "More Options" submenu? Wondering if something like this would be possible:

/path/to/wdd.exe --refresh-wallpaper