New and Improved Wallpaper Generator

Sweet! I like the margins on it! Thank you for providing the numbers! That reminds me that I need to update the margins for the phones on the site, because they’re totally not accurate yet. (It’d help if I had every model of phone, but alas, I don’t).

1 Like

It didn’t work at all this time :confused: I tried having it set the wallpaper to a different image and then to the kanji wallpaper. (I think there’s a bug in the OS that prevents the wallpaper from changing unless the file path changes.) It did work once, but only once, sadly.
The script still updates the kanji wallpaper inside the folder, but the desktop only changes to my second image and then to the same one version of the kanji wallpaper every time, even though there’s a different version in the folder. Restarting my computer seems to be the only thing that can get it to change.

I’ll see what else I can do tomorrow, if anything, but it’s a bit late where I am.

Edit: just restarted my computer again and did the same thing, and now it works?? :woman_shrugging: It only works if it sets to a different image first and then the kanji wallpaper. I tried it with and without that step.

1 Like
Contains My General Struggle With The Code

I gave it a go and still have some slight errors.


Not sure how I have no administrative rights, I did the whole powershell thing you said. Also it apparently is not able to find a path?

EDIT: I gave myself administrative rights by entering the named folders in the File Explorer, but the errors just kind of changed.

EDIT2: Gave all my subcontainers the same rights, so now I can just come and go as I want in SystemData. Only got these errors now:

Error Message
Downloading wallpaper
Setting wallpaper
Setting lock screen image
ERROR: The current logged on user does not have administrative privileges.
processed file: C:\ProgramData\Microsoft\Windows\SystemData
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-18
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-18\ReadOnly
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-18\ReadOnly\LockScreen_Z
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_A
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_B
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_D
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_E
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_F
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_G
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_O
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_A\LockScreen.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_A\LockScreen___0108_0108.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_A\LockScreen___0151_0151.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_A\LockScreen___0194_0194.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_A\LockScreen___1920_1080_notdimmed.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_B\LockScreen.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_B\LockScreen___0108_0108.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_B\LockScreen___0151_0151.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_B\LockScreen___0194_0194.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_B\LockScreen___1920_1080_notdimmed.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_D\LockScreen.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_D\LockScreen___0108_0108.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_D\LockScreen___0151_0151.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_D\LockScreen___0194_0194.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_D\LockScreen___1920_1080_notdimmed.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_E\LockScreen.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_E\LockScreen___0108_0108.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_E\LockScreen___0151_0151.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_E\LockScreen___0194_0194.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_E\LockScreen___1024_0768_notdimmed.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_E\LockScreen___1920_1080_notdimmed.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_F\LockScreen.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_F\LockScreen___0108_0108.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_F\LockScreen___0151_0151.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_F\LockScreen___0194_0194.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_F\LockScreen___1680_1050_notdimmed.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_F\LockScreen___1920_1080_notdimmed.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_G\LockScreen.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_G\LockScreen___0108_0108.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_G\LockScreen___0151_0151.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_G\LockScreen___0194_0194.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_G\LockScreen___1920_1080_notdimmed.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_O\LockScreen___1920_1080_notdimmed.jpg
Successfully processed 46 files; Failed processing 0 files
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-18\ReadOnly
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-18\ReadOnly\LockScreen_Z
Successfully processed 2 files; Failed processing 0 files
ERROR: The current logged on user does not have administrative privileges.
C:\Windows\Web\Screen: Access is denied.
Successfully processed 0 files; Failed processing 1 files
C:\Windows\Web\Screen: Access is denied.
Successfully processed 0 files; Failed processing 1 files

EDIT3: Also gave the access to the Web/Screen folder, now the system goes through the code, but the lockscreen doesn’t really change. :sweat_smile:

EDIT4: Been trying to get it to work, haven’t succeeded yet. However, it seems that sometimes Microsoft turns the administrative rights back. I did the PowerShell thing, so not sure why I had to do that in the first place

1 Like

Sorry! I forgot to say that the batch file needs to be run as administrator for PowerShell to work right. I just realized that this was never mentioned in the instructions on the site or in my recent post. I was having the same errors as you, but running the batch file as administrator got rid of them (well, all of them except for the “Remote Item : Cannot find path” errors, which you can safely ignore).

So, please right-click the update.bat batch file and choose Run as administrator and let me know if everything works then. If it does work, then please do the following as well:

Run as admin always

Open your update.bat file in notepad, and paste this at the top of the file before any other code. This code just makes it so that it will always want to run as administrator so that you don’t have to right-click->“run as administrator” every time. You will still get that UAC prompt asking for permission.

::::::::::::::::::::::::::::::::::::::::::::
:: Automatically check & get admin rights V2
::::::::::::::::::::::::::::::::::::::::::::
@echo off
CLS
ECHO.
ECHO =============================
ECHO Running Admin shell
ECHO =============================

:init
setlocal DisableDelayedExpansion
set "batchPath=%~0"
for %%k in (%0) do set batchName=%%~nk
set "vbsGetPrivileges=%temp%\OEgetPriv_%batchName%.vbs"
setlocal EnableDelayedExpansion

:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )

:getPrivileges
if '%1'=='ELEV' (echo ELEV & shift /1 & goto gotPrivileges)
ECHO.
ECHO **************************************
ECHO Invoking UAC for Privilege Escalation
ECHO **************************************

ECHO Set UAC = CreateObject^("Shell.Application"^) > "%vbsGetPrivileges%"
ECHO args = "ELEV " >> "%vbsGetPrivileges%"
ECHO For Each strArg in WScript.Arguments >> "%vbsGetPrivileges%"
ECHO args = args ^& strArg ^& " "  >> "%vbsGetPrivileges%"
ECHO Next >> "%vbsGetPrivileges%"
ECHO UAC.ShellExecute "!batchPath!", args, "", "runas", 1 >> "%vbsGetPrivileges%"
"%SystemRoot%\System32\WScript.exe" "%vbsGetPrivileges%" %*
exit /B

:gotPrivileges
setlocal & pushd .
cd /d %~dp0
if '%1'=='ELEV' (del "%vbsGetPrivileges%" 1>nul 2>nul  &  shift /1)

Edit: Also, if you modified the update.bat file or the lockscreen.ps1 file since my last post, undo those changes.

1 Like

I really wish I had a Mac to test this out with! I’m wondering if Mac OS X caches the wallpaper elsewhere and realizes that the image path is the same and therefore doesn’t update it.

Can you try updating your code to this and see if it works?

Code

The difference here is the addition and usage of a NOW=$(date etc) line, which makes a variable with the value of today’s date and time, which will always be unique each time the script is run. This value is then used for the filename for the wallpaper it downloads and sets. If this works, then your computer will never have an old “wallpaper.png” in its cache because it won’t ever be called the same thing.

Notice that the last two lines also need to be edited with a $NOW added, like wallpaper-$NOW.png.

#!/bin/bash

NOW=$(date +"%F_%H%M%S")

cd "$(dirname "$0")"
curl -s -A "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36" -o "wallpaper-$NOW.png" "http://wkw.natural20design.com/?k={{YOUR_API_KEY_HERE}}&d=1"
osascript -e "tell application \"System Events\" to tell every desktop to set picture to \"$(dirname "$0")/wallpaper-$NOW.png\""

I’m really digging the random feature! Got this beautiful theme on first try. Looks really good on my iPhone which, for some reason has lower gamma and more purple than my PC.

1 Like

For some reason it is actually doing my background, which I didn’t notice during testing, as it was already changed during the initial basic testing.

What is going wrong in my update.bat, and how do I prevent my wallpaper from changing?

@cd /d %~dp0
@echo Downloading wallpaper
@curl -s -A "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36" -o wallpaper.png "http://wkw.natural20design.com/?k=2fea2e06-30c8-423f-9b56-73bbefa89b45&d=1"
@echo Setting wallpaper
@WallpaperChanger.exe wallpaper.png
@echo Setting lock screen image
@powershell -File "lockscreen.ps1"
@echo Done

To stop your wallpaper from updating, remove these two lines:

@echo Setting wallpaper
@WallpaperChanger.exe wallpaper.png

Is the lockscreen working now?

1 Like

The Run as Administrator does avoid the errors, but after running the program, nothing has really changed. :frowning:

Here is what is written when it runs.

Code
=============================
Running Admin shell
=============================
Downloading wallpaper
Setting lock screen image

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-18" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-18\ReadOnly" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-18\ReadOnly\LockScreen_Z" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_A" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_B" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_D" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_E" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_F" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_G" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_O" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_A\LockScreen.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_A\LockScreen___0108_0108.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_A\LockScreen___0151_0151.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_A\LockScreen___0194_0194.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_A\LockScreen___1920_1080_notdimmed.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_B\LockScreen.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_B\LockScreen___0108_0108.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_B\LockScreen___0151_0151.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_B\LockScreen___0194_0194.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_B\LockScreen___1920_1080_notdimmed.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_D\LockScreen.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_D\LockScreen___0108_0108.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_D\LockScreen___0151_0151.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_D\LockScreen___0194_0194.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_D\LockScreen___1920_1080_notdimmed.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_E\LockScreen.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_E\LockScreen___0108_0108.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_E\LockScreen___0151_0151.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_E\LockScreen___0194_0194.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_E\LockScreen___1024_0768_notdimmed.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_E\LockScreen___1920_1080_notdimmed.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_F\LockScreen.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_F\LockScreen___0108_0108.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_F\LockScreen___0151_0151.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_F\LockScreen___0194_0194.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_F\LockScreen___1680_1050_notdimmed.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_F\LockScreen___1920_1080_notdimmed.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_G\LockScreen.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_G\LockScreen___0108_0108.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_G\LockScreen___0151_0151.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_G\LockScreen___0194_0194.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_G\LockScreen___1920_1080_notdimmed.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_O\LockScreen___1920_1080_notdimmed.jpg" now owned by the administrators group.
processed file: C:\ProgramData\Microsoft\Windows\SystemData
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-18
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-18\ReadOnly
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-18\ReadOnly\LockScreen_Z
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_A
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_B
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_D
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_E
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_F
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_G
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_O
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_A\LockScreen.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_A\LockScreen___0108_0108.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_A\LockScreen___0151_0151.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_A\LockScreen___0194_0194.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_A\LockScreen___1920_1080_notdimmed.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_B\LockScreen.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_B\LockScreen___0108_0108.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_B\LockScreen___0151_0151.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_B\LockScreen___0194_0194.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_B\LockScreen___1920_1080_notdimmed.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_D\LockScreen.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_D\LockScreen___0108_0108.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_D\LockScreen___0151_0151.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_D\LockScreen___0194_0194.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_D\LockScreen___1920_1080_notdimmed.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_E\LockScreen.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_E\LockScreen___0108_0108.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_E\LockScreen___0151_0151.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_E\LockScreen___0194_0194.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_E\LockScreen___1024_0768_notdimmed.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_E\LockScreen___1920_1080_notdimmed.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_F\LockScreen.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_F\LockScreen___0108_0108.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_F\LockScreen___0151_0151.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_F\LockScreen___0194_0194.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_F\LockScreen___1680_1050_notdimmed.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_F\LockScreen___1920_1080_notdimmed.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_G\LockScreen.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_G\LockScreen___0108_0108.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_G\LockScreen___0151_0151.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_G\LockScreen___0194_0194.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_G\LockScreen___1920_1080_notdimmed.jpg
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-21-42844226-3888316730-3926257279-1001\ReadOnly\LockScreen_O\LockScreen___1920_1080_notdimmed.jpg
Successfully processed 46 files; Failed processing 0 files
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-18\ReadOnly
processed file: C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-18\ReadOnly\LockScreen_Z
Successfully processed 2 files; Failed processing 0 files

SUCCESS: The file (or folder): "C:\Windows\Web\Screen" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\Windows\Web\Screen\img100.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\Windows\Web\Screen\img101.png" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\Windows\Web\Screen\img102.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\Windows\Web\Screen\img103.png" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\Windows\Web\Screen\img104.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\Windows\Web\Screen\img105.jpg" now owned by the administrators group.

SUCCESS: The file (or folder): "C:\Windows\Web\Screen\img200.jpg" now owned by the administrators group.
processed file: C:\Windows\Web\Screen
processed file: C:\Windows\Web\Screen\img100.jpg
processed file: C:\Windows\Web\Screen\img101.png
processed file: C:\Windows\Web\Screen\img102.jpg
processed file: C:\Windows\Web\Screen\img103.png
processed file: C:\Windows\Web\Screen\img104.jpg
processed file: C:\Windows\Web\Screen\img105.jpg
processed file: C:\Windows\Web\Screen\img200.jpg
Successfully processed 8 files; Failed processing 0 files
processed file: C:\Windows\Web\Screen
processed file: C:\Windows\Web\Screen\img100.jpg
processed file: C:\Windows\Web\Screen\img101.png
processed file: C:\Windows\Web\Screen\img102.jpg
processed file: C:\Windows\Web\Screen\img103.png
processed file: C:\Windows\Web\Screen\img104.jpg
processed file: C:\Windows\Web\Screen\img105.jpg
processed file: C:\Windows\Web\Screen\img200.jpg
Successfully processed 8 files; Failed processing 0 files

It does work. I think you’re right about it caching the wallpaper. Thanks so much for helping! :grinning:

Okay, I think I know what’s up. This script works by replacing the default lock screen image, and if you already set your lock screen image to some other file, then replacing the default lock screen image won’t do anything.

Please follow these instructions to reset your lock screen back to normal:

Reset lock screen back to normal

If you go to C:\Windows\Web\Screen\, do you see your kanji wallpaper there named img100.jpg? If you do, delete it, and then rename img200.jpg to img100.jpg, so that your folder looks something like mine:

Then, go to Settings → Personalization → Lock screen, and reset the image to the normal default one by changing the Background drop-down to Picture (if it’s not like that already), and then clicking on the default image, which is whatever your img100.jpg is.

image

If you don’t see your img100.jpg in those five pictures under “Choose your picture”, let me know.

Edit: if you click the Browse button, you should be able to select img100.jpg by typing C:\Windows\Web\Screen\100.jpg in the File name box, as pictured, and then hitting the Choose picture button.


And then try running the script again.

1 Like
Summary

So I checked again, and in …/Windows/Web/Screen, the pictures are actually changing accordingly. My lock screen however is not?

Furthermore, when I manually change my lockscreen, the image does not actually change the files in Windows/Web/Screen.

Here are the images after that change:

And here is my lockscreen:

So maybe it’s not the right folder?

I'm an idiot

EDIT: So I just found all my manual pictures in this folder?

EDIT 2:
nvm, that’s where I just simply saved all the images before using them as lock screen

First, your lock screen image is lovely.

Second, can you try setting your lock screen image to C:\Windows\Web\Screen\100.jpg? by going to Settings → Personalization → Lock Screen → Browse? (I said this in the last post, but it was in an edit so you might not have seen it.)

Ah dang that actually did the trick.
Sorry for wasting your time. :pensive::sweat_smile:

Thank you for your hard work.

Still the same. Not updating

Hey @emucat, can you try updating your code so it has the $NOW edit in it from one of my other posts?

This post: $NOW edit ($NOW is just a variable with the value of today’s date and time that’s used to differentiate each instance of the wallpaper from each other).

I’m wondering if the latest Mac OS X caches wallpapers differently and if you and maggiekarp have the same update.

Edit: Actually, can you help me test something? That post I linked is just a temporary solution. The new code saves the wallpaper without overwriting the old one, so they build up. Can you add this line before the curl but after the cd line and then send me a screenshot of what it looks like? It should list out the .png files in your WaniKani Wallpaper folder and only those files.

find . -iname '*.png' -type f

Complete code file
#!/bin/bash
NOW=$(date +"%F_%H%M%S")
cd "$(dirname "$0")"
find . -iname '*.png' -type f
curl -s -A "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36" -o "wallpaper-$NOW.png" "http://wkw.natural20design.com/?k={{YOUR_API_KEY_HERE}}&d=1"
osascript -e "tell application \"System Events\" to tell every desktop to set picture to \"$(dirname "$0")/wallpaper-$NOW.png\""

The next step would be to add a keyword to delete those images, but I want to make sure it’s finding the right files before I accidentally delete every PNG off of your computer :sweat_smile:

Thank you very much! The first thing I did was to modify the Mac code to run on my Linux machine.

This is what I got working on Ubuntu 18.04
#!/bin/bash
curl -s -A "USER_AGENT" -o "wallpaper.png" "http://wkw.natural20design.com/?k=API_KEY&d=1"
gsettings set org.gnome.desktop.background picture-uri "file://$PWD/wallpaper.png"

Unfortunately, I don’t like the way the font is rendered, compared to the old tool by @akranis. Can you see how the font is significantly more blurry on the second image? I did not change any settings apart from margins and screen resolution.

wallpaper_old wallpaper_new

@Masayoshiro Any chance you can beautify this tool with crisper font rendering?

1 Like

This is really impressive! You’ve included so many different features and options, it’s super cool!

So far so good…

I’ll let you know if it keeps updating fine

This seems to be working fine, but I’m getting a good collection of wallpapers (I’m running the script every hour) that I have to delete manually.