It is currently November 29th, 2020, 4:19 pm

Plugin - GetWallpaper

Share and get help with Plugins and Addons
prince1142003
Posts: 56
Joined: December 27th, 2011, 12:32 pm

Plugin - GetWallpaper

Post by prince1142003 »

I needed a way to get the current wallpaper file in Windows, and couldn't find anything built into Rainmeter that I could use. So I spent some time writing a plugin for it.

This plugin provides the current wallpaper file that Windows is using natively. Can be used to get the current wallpaper file if a slideshow is running. There is also an option to get the wallpaper for a specific monitor (only Windows 8 and above support this natively).

Note: the plugin may not work when using third-party software like DisplayFusion.
WindowsWallpaper.png
Options

Monitor: Which monitor to use. Only applicable for multi monitor systems using Windows 8 and above. It can be a static value or a dynamic value. If a dynamic value is needed, DynamicVariables=1 must be set on the measure. If omitted, the plugin defaults to the primary monitor.

The attached rmskin file also contains my Lua implementation to detect the current monitor for a skin. The value is used by the plugin to determine which monitor's wallpaper to return. More details on the Lua script here: http://rainmeter.net/forum/viewtopic.php?p=114355#p114355

This is my first plugin, so if there are any issues please post here. I will try to get them resolved.
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 11827
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Plugin - GetWallpaper

Post by balala »

I'm not very sure you need a such plugin:

Code: Select all

[Rainmeter]
Update=5000
AccurateText=1
DynamicWindowSize=1
SolidColor=0,0,0,128
BackgroundMode=2
Blur=1

[Wallpaper]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Control Panel\Desktop
RegValue=Wallpaper

[Uptime]
MeasureName=Wallpaper
Meter=STRING
X=0
Y=25
W=180
H=50
Padding=5,0,5,0
ClipString=1
FontColor=220,220,220
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFTCENTER
AntiAlias=1
Text=%1

[Image]
MeasureName=Wallpaper
Meter=IMAGE
X=0r
Y=-25R
W=120
H=90
PreserveAspectRatio=1
This works for sure in Windows 7, but I'm not sure how it does in Windows 8.1 or 10.
prince1142003
Posts: 56
Joined: December 27th, 2011, 12:32 pm

Re: Plugin - GetWallpaper

Post by prince1142003 »

That was my very first attempt. There were two main limitations with that method for me.

1. That registry key stores the location of the transcoded file that windows creates and stores in the Roaming profile. It doesn't provide the path to the original file. In other words, it is always the same value. This makes it hard to use any OnChangeAction bangs on it.
2. It breaks down in multi-monitor environments. Starting with Windows 8, you can separately specify the wallpaper for each monitor. The above reg key only returns the wallpaper for the primary monitor.

True, this might be a niche category and not all that useful to everyone. I'm using it to generate a color scheme for skins based on the wallpaper (still in progress).
User avatar
balala
Rainmeter Sage
Posts: 11827
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Plugin - GetWallpaper

Post by balala »

I'm not using neither multi-monitor, neither Windows 8. I just had that idea when I read your post, but I think you're right.