It is currently October 13th, 2024, 1:04 am

[Suggestion] Built-in variable #CURRENTCONFIGSCREEN#

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

[Suggestion] Built-in variable #CURRENTCONFIGSCREEN#

Post by Cariboudjan »

Maybe there is already an easy way to do this that I'm not aware of, but I would love a dynamic built-in variable that outputs the screen the current config is currently on.

eg.

Screen 1 - Output = 1
Screen 2 - Output = 2
Screen 3 - Output = 3
User avatar
Yincognito
Rainmeter Sage
Posts: 8441
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

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

Post by Yincognito »

Cariboudjan wrote: March 25th, 2022, 6:13 pm Maybe there is already an easy way to do this that I'm not aware of, but I would love a dynamic built-in variable that outputs the screen the current config is currently on.

eg.

Screen 1 - Output = 1
Screen 2 - Output = 2
Screen 3 - Output = 3
Not really what you want, but indirectly, isn't what AutoSelectScreen and the related bang does to the monitor variables? :???:

I can't test it since I don't have the system for it, but it looks to do what you mentioned ... except in reverse. Or at least that's what I understand from there.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Cariboudjan
Posts: 285
Joined: May 12th, 2019, 8:55 am

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

Post by Cariboudjan »

Yes, but I need it to do the reverse
User avatar
Yincognito
Rainmeter Sage
Posts: 8441
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

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

Post by Yincognito »

Cariboudjan wrote: March 25th, 2022, 9:25 pm Yes, but I need it to do the reverse
Yep, indeed. I was going to say that you could find the N in Lua by comparing #SCREENAREAX#, #SCREENAREAY#, #SCREENAREAWIDTH#, #SCREENAREAHEIGHT# (which would refer to the desired monitor, if the auto select stuff is used) with #SCREENAREAX@N#, #SCREENAREAY@N#, #SCREENAREAWIDTH@N#, #SCREENAREAHEIGHT@N#, using a FOR like this:

@Resources\Script.lua:

Code: Select all

function MonitorVariables()
  local n, monitorvariables = 0, ''
  for i = 1, 10 do
    if tonumber(SKIN:ReplaceVariables('#SCREENAREAX@' .. i .. '#')) == tonumber(SKIN:ReplaceVariables('#SCREENAREAX#')) and
       tonumber(SKIN:ReplaceVariables('#SCREENAREAY@' .. i .. '#')) == tonumber(SKIN:ReplaceVariables('#SCREENAREAY#')) and
       tonumber(SKIN:ReplaceVariables('#SCREENAREAWIDTH@' .. i .. '#')) == tonumber(SKIN:ReplaceVariables('#SCREENAREAWIDTH#')) and
       tonumber(SKIN:ReplaceVariables('#SCREENAREAHEIGHT@' .. i .. '#')) == tonumber(SKIN:ReplaceVariables('#SCREENAREAHEIGHT#')) then n = i end
    monitorvariables = monitorvariables .. i .. ': ' .. SKIN:ReplaceVariables('#SCREENAREAX@' .. i .. '#, #SCREENAREAY@' .. i .. '#, #SCREENAREAWIDTH@' .. i .. '#, #SCREENAREAHEIGHT@' .. i .. '#') .. '\r\n'
  end
  return 'N = ' .. n .. '\r\n' .. monitorvariables
end
Skin.ini:

Code: Select all

[Variables]

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=47,47,47,255

---Measures---

[Script]
Measure=Script
ScriptFile=#@#Script.lua
UpdateDivider=-1

---Meters---

[MeterTest]
Meter=String
FontFace=Consolas
FontColor=255,255,255,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
Text="Monitor Variables:#CRLF#[&Script:MonitorVariables()]"
UpdateDivider=-1
DynamicVariables=1
but it appears those monitor variables aren't that unique to each monitor, at least in my case (a single actual monitor, but 3 identical ones seen):
MonitorVariables.jpg
Anyway, maybe it can give you some ideas, until the devs answer this.
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth