It is currently March 28th, 2024, 3:09 pm

[Suggestion] Built-in variable #CURRENTCONFIGMONITOR#

Report bugs with the Rainmeter application and suggest features.
Post Reply
User avatar
Cariboudjan
Posts: 261
Joined: May 12th, 2019, 8:55 am

[Suggestion] Built-in variable #CURRENTCONFIGMONITOR#

Post by Cariboudjan »

I'm actually surprised this isn't already a built-in variable. #CURRENTCONFIGMONITOR# returning 1, 2, 3, 4, etc. depending on the monitor the skin is currently on.

I'm using this:

Code: Select all

[Rainmeter]
SkinWidth=[#WORKAREAWIDTH]
with AutoSelectScreen=1 in Rainmeter.ini. SkinWidth= does not use the AutoSelectScreen value when Rainmeter is opened. Only if the skin is later refreshed after open. Continues to use Work Area Width of the primary monitor. Incorrect Work Area persists. Would be solvable with [#WORKAREAWIDTH@[#CURRENTCONFIGMONITOR]].
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: [Suggestion] Built-in variable #CURRENTCONFIGMONITOR#

Post by Brian »

Looks like a duplicate of your previous thread.

I am not opposed to this in general, but honestly, I am not too sure how beneficial it will be to most skins. Plus, it might be difficult to determine which screen to return if the skin spans across multiple monitors (either very large skins, or when KeepOnScreen=0).

The real is issue is the time it to implement this, which seems to be ever decreasing lately (at least for me). :(

There are some important projects I would like to really get done before too long, so unfortunately, this might be put on the back burner for now.

-Brian
User avatar
Yincognito
Rainmeter Sage
Posts: 7023
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Suggestion] Built-in variable #CURRENTCONFIGMONITOR#

Post by Yincognito »

Cariboudjan wrote: January 24th, 2023, 9:29 pmSkinWidth= does not use the AutoSelectScreen value when Rainmeter is opened. Only if the skin is later refreshed after open.
This is probably because:
- the [Rainmeter] section not supporting dynamic variables while monitor variables and AutoSelectScreen require it; the result is the value being static
- if it happens only when Rainmeter is opened at startup, it could be related to not having enough time to initialize stuff, though that's unlikely
- if it happens every time Rainmeter is opened even if not at startup, then it's clear that the -1 aka the primary monitor is still the value of @N

Possible workarounds:
- use DynamicWindowSize=1 and a dynamic Shape or Image meter as a background to set the skin dimensions, to freely use dynamic monitor variables
- use a separate "loader" skin to force a refresh on the main skin after some reasonable delay for loading it
- use the !AutoSelectScreen bang and a refresh once (via some other dynamic variable that triggers and cancels it) in your last meter instead

Note: Testing is required for the above. I would have done it myself if I had multiple monitors, but although my registry seems to disagree, I don't. I might have missed some variations for the said hypothetical workarounds because of that. Also, some variants may only act after the first refresh / update happens in the main skin, so for a split second the skin could still use the wrong work area before it is "stabilized".
Post Reply