eclectic-tech wrote: ↑March 12th, 2022, 10:53 pmThere was no straightforward way to determine the user's aspect setting, so I added a fallback for the cached file name using an end user variable for the aspect number.
I beg to differ...
See
here and
here for incomplete answers, just for reference, since I already had the answer at that moment. Or, based on my own testing, just before I looked for the links above:
-
Center:
POS = 0
HKEY_CURRENT_USER\Control Panel\Desktop\TileWallpaper = 0
HKEY_CURRENT_USER\Control Panel\Desktop\WallpaperStyle = 0
-
Tile:
POS = 1
HKEY_CURRENT_USER\Control Panel\Desktop\TileWallpaper = 1
HKEY_CURRENT_USER\Control Panel\Desktop\WallpaperStyle = 0
-
Stretch:
POS = 2
HKEY_CURRENT_USER\Control Panel\Desktop\TileWallpaper = 0
HKEY_CURRENT_USER\Control Panel\Desktop\WallpaperStyle = 2
-
Fit:
POS = 3
HKEY_CURRENT_USER\Control Panel\Desktop\TileWallpaper = 0
HKEY_CURRENT_USER\Control Panel\Desktop\WallpaperStyle = 6
-
Fill:
POS = 4
HKEY_CURRENT_USER\Control Panel\Desktop\TileWallpaper = 0
HKEY_CURRENT_USER\Control Panel\Desktop\WallpaperStyle = 10
-
Span:
POS = 5
HKEY_CURRENT_USER\Control Panel\Desktop\TileWallpaper = 0
HKEY_CURRENT_USER\Control Panel\Desktop\WallpaperStyle = 22
I'd say this is pretty straightforward, don't you think?
Basically the whole thing is a bit of joggle or combination between checking those folders / files and the above Desktop location keys in the registry. Or, you could do it just with a couple Registry measures and go right to the file itself, if by any chance you only want that folder being used and don't care for "web" wallpapers. Other than that, you can very much have a fallback manual method similar to what you mentioned, if things go south somehow.
Summarizing, the cached file name would be:
Code: Select all
%appdata%\Microsoft\Windows\Themes\CachedFiles\CachedImage_(#SCREENAREAWIDTH#-#SCREENAREAX#)_(#SCREENAREAHEIGHT#-#SCREENAREAY#)_POS[StringMeasureWithASubstituteReplacingTheConcatenatedTileWallpaperAndWallpaperStyleWithTheCorrespondingPOSition].jpg
P.S. Don't ask me how Microbfuscatedsoft came up with those numbers in the registry though - not even hex numbers match, not to mention the gaps in values. Yeah, you gotta love Windows ... and slap Macrohard for not making this a walk in the park for the regular user, but who knows, maybe they have their reasons...
EDIT: And since I don't like to let stuff unfinished, here's the previous sample skin with the above (it doesn't do anything on errors or use the transcoded or any "web" image, it just patiently waits for the cached image to be created in order to use it, and doesn't use any fallback method since I you said you got that part covered - feel free to have a look and see this part of the process is feasible):
Code: Select all
[Variables]
FontFaceDay=Tahoma
FontFaceTime=Calibri
FontColW=255,255,255,255
FontColB=0,0,0,255
FontWeight=700
StringCase=Upper
Size=48
SizeFactor=3
XPadding=(-2*#SizeFactor#)
YPadding=(-3*#SizeFactor#)
Angle=0
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
---Measures---
[Day]
Measure=Time
Format="%A%A"
[Time]
Measure=Time
Format="%I:%M"
[ScreenW]
Measure=Calc
Formula=(#SCREENAREAWIDTH#-#SCREENAREAX#)
DynamicVariables=1
[ScreenH]
Measure=Calc
Formula=(#SCREENAREAHEIGHT#-#SCREENAREAY#)
DynamicVariables=1
[TileWallpaperStatus]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Control Panel\Desktop
RegValue=TileWallpaper
[WallpaperStyleStatus]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Control Panel\Desktop
RegValue=WallpaperStyle
[FitPosition]
Measure=String
String=[TileWallpaperStatus][WallpaperStyleStatus]
RegExpSubstitute=1
Substitute="^00$":"0","^10$":"1","^02$":"2","^06$":"3","^010$":"4","^022$":"5"
DynamicVariables=1
[MagickMeter]
Measure=Plugin
Plugin=MagickMeter
Image=File %appdata%\Microsoft\Windows\Themes\CachedFiles\CachedImage_[ScreenW]_[ScreenH]_POS[FitPosition].jpg | Crop #CURRENTCONFIGX#, #CURRENTCONFIGY#, #CURRENTCONFIGWIDTH#, #CURRENTCONFIGHEIGHT# | Blur 0,0
DynamicVariables=1
---Styles---
[TextStyle]
Y=-4R
FontFace=#FontFaceDay#
FontSize=#Size#
FontColor=#FontColW#
FontWeight=#FontWeight#
StringCase=#StringCase#
Angle=#Angle#
Padding=#XPadding#,#YPadding#,#XPadding#,#YPadding#
AntiAlias=1
---Meters---
[DayTextLine1]
Meter=String
MeterStyle=TextStyle
MeasureName=Day
[DayTextLine2]
Meter=String
MeterStyle=TextStyle
MeasureName=Day
[DayTextLine3]
Meter=String
MeterStyle=TextStyle
MeasureName=Day
[DayTextLine4]
Meter=String
MeterStyle=TextStyle
MeasureName=Day
[DayTextLine5]
Meter=String
MeterStyle=TextStyle
MeasureName=Day
[TimeText]
Meter=String
MeterStyle=TextStyle
X=(#CURRENTCONFIGWIDTH#/2)
Y=(#CURRENTCONFIGHEIGHT#/2)
W=(#CURRENTCONFIGWIDTH#)
H=(#CURRENTCONFIGHEIGHT#)
FontFace=#FontFaceTime#
FontSize=(#Size#*#SizeFactor#)
FontColor=#FontColB#
Padding=0,0,0,0
StringAlign=CenterCenter
MeasureName=Time
DynamicVariables=1
[WallpaperImage]
Meter=Image
Container=TimeText
X=(-#CURRENTCONFIGWIDTH#/2)
Y=(-#CURRENTCONFIGHEIGHT#/2)
MeasureName=MagickMeter
DynamicVariables=1
I would also note 2 things:
- I have no idea how the process is altered (if it does) on multi-monitor systems, probably some tests should be done in such an enivironment to see if adjustments are needed
- once an initially tiled image is stored in the cached folder, on reapply the image ceases to be tiled anymore, since it's basically that single image taken from that folder