It is currently March 28th, 2024, 8:31 pm

Reposition for diffeent resolutions

Get help with installing and using Rainmeter.
therock003
Posts: 14
Joined: May 13th, 2013, 9:20 am

Reposition for diffeent resolutions

Post by therock003 »

I've installed rainmeter on a laptop, that is either runing on its own monitor or external monitors. Each time i connect to minitors i have to drag the skins around to match. Because resolution do not have the same aspect ratio and dont scale correctly. How can i configure it in a way that on every resolution on the screens i use the skins align the way i want them to
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: Reposition for diffeent resolutions

Post by SilverAzide »

Create and save a different layout for each screen resolution. You can then manually select the layout you want when your resolution changes. You can also create a skin (or find an existing one) that watches your current screen resolution and automatically loads the proper layout when your resolution changes. Depending on the layout you want, there are skin positioning options (Settings > Position) that will allow relative positioning, such that you might not need to use layouts.
Gadgets Wiki GitHub More Gadgets...
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Reposition for diffeent resolutions

Post by balala »

SilverAzide wrote:You can also create a skin (or find an existing one) that watches your current screen resolution and automatically loads the proper layout when your resolution changes.
Or a probably simpler solution (instead of creating a such skin), would be to use the RainRez app, which can load a layout depending on the current screen resolution.
therock003
Posts: 14
Joined: May 13th, 2013, 9:20 am

Re: Reposition for diffeent resolutions

Post by therock003 »

Thank you guys. I wouldnt want an app running at all times though for this, so the layout option is better. Lets say i save each scenario for every monitor i usually connect on. Is there any hotkey to switch between layouts when doing it manually, otherwise how do i out with that skin method mentioned
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Reposition for diffeent resolutions

Post by balala »

therock003 wrote:ThLets say i save each scenario for every monitor i usually connect on. Is there any hotkey to switch between layouts when doing it manually, otherwise how do i out with that skin method mentioned
Are you using both monitors in the same time or either one or the other at a time?
therock003
Posts: 14
Joined: May 13th, 2013, 9:20 am

Re: Reposition for diffeent resolutions

Post by therock003 »

Each a time.

I'm either going to be using the laptops Monitor when I'm on the go, or connect to an External Monitor (with lid closed) when im at home or the Office
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Reposition for diffeent resolutions

Post by balala »

therock003 wrote:Each a time.

I'm either going to be using the laptops Monitor when I'm on the go, or connect to an External Monitor (with lid closed) when im at home or the Office
I'm using one single monitor, so I can't test the following code (which requires at least two monitors), but I hope it does work.
First save the two layouts. They will have specific names, like Layout-For-First-Monitor respectively Layout-For-Second-Monitor. The appropriate layout will be loaded depending on the width of the screen. For this I added the [MeasureScreenWidth] Calc measure, which returns the width of the screen. In the IfCondition options of this measure, you have to ad the appropriate width of the two monitors you are using.
Please test this code and let me know if it does work. If it doesn't (as I said I can't test it), I'll modify it for manual switching between the layouts.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[MeasureScreenWidth]
Measure=Calc
Formula=#SCREENAREAWIDTH#
IfCondition=(#CURRENTSECTION#=1920)
IfTrueAction=[!LoadLayout "Layout-For-First-Monitor"][!SetOption MeterMonitor Text "First Monitor"]
IfCondition2=(#CURRENTSECTION#=1024)
IfTrueAction2=[!LoadLayout "Layout-For-Second-Monitor"][!SetOption MeterMonitor Text "Second Monitor"]

[MeterMonitor]
Meter=STRING
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=18
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Note that the skin shows the current width. If the skin works well, you can add a Hidden=1 option to the [MeterMonitor] meter, to hide it. This way, the skin won't have visible elements, it'll run "in background". For first I let the meter visible, to have a control over it.
therock003
Posts: 14
Joined: May 13th, 2013, 9:20 am

Re: Reposition for diffeent resolutions

Post by therock003 »

I dont think it'll work with just the width for me, cause Office Monitor is 1920x1080, and my home Monitor is 1920x1200. So it will need something that goes with the complete resolution not just triggered by width

Also i see update=1000 on your script. Is that measured in "ms" meaning it will run every second? Wont that eat up the cpu and drain battery
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Reposition for diffeent resolutions

Post by balala »

therock003 wrote:I dont think it'll work with just the width for me, cause Office Monitor is 1920x1080, and my home Monitor is 1920x1200. So it will need something that goes with the complete resolution not just triggered by width
In this case I'd use the height, instead of the width. Rewrite the [MeasureScreenWidth] measure to the following [MeasureScreenHeight]:

Code: Select all

[MeasureScreenHeight]
Measure=Calc
Formula=#SCREENAREAHEIGHT#
IfCondition=(#CURRENTSECTION#=1080)
IfTrueAction=[!LoadLayout "Layout-For-First-Monitor"][!SetOption MeterMonitor Text "First Monitor"]
IfCondition2=(#CURRENTSECTION#=1200)
IfTrueAction2=[!LoadLayout "Layout-For-Second-Monitor"][!SetOption MeterMonitor Text "Second Monitor"]
therock003 wrote:Also i see update=1000 on your script. Is that measured in "ms" meaning it will run every second? Wont that eat up the cpu and drain battery
Not run, but updated, but finally yes, that's the idea (the Update value is expressed in milliseconds). It doesn't, in most cases (and this is the default setting) the Rainmeter skins are updated so, once per second. For today's computers this isn't a big deal.
therock003
Posts: 14
Joined: May 13th, 2013, 9:20 am

Re: Reposition for diffeent resolutions

Post by therock003 »

Ok i modded the text to fit my case. How do i implement it though?

I selected create new skin, then added new folder, and new screen, and pasted the text inside the .ini. But when i go to press load on the rainmeneter manage dialogue it does not seem to load