It is currently September 29th, 2024, 5:41 pm

Screen rotation

General topics related to Rainmeter.
maria_fj
Posts: 7
Joined: December 8th, 2013, 8:42 am

Screen rotation

Post by maria_fj »

Hi,

I am new to RainMeter and I am surprised about the functions and skins provided. I am currently not sure if my question is a Skin related one or a generic one. Lets try it here first.

I have adjusted my Skin in that sense that if fits on my second monitor very well in the different borders. Now, when I detach my laptop to work standalone the screen resolution changes. And as well the orientation. Now the very well aligned skin on my monitor looks horrible as a standalone version. e.g. border is in the middle, not completely filled to the bottom, missing items, overlapping items, etc.

I would have expected that the positions of the items would change dynamically and in relation to the previous settings as soon as the resolution resp. orientation changes.

Is there a way to achieve this? (Have proper positioning, completely filled out borders, etc)
What is the recommended approach?
What is the difference in the menu Settings -> Position -> Desktop, X position, relativ... ???
What should the option Adjust automatic position depending from Frame setting (German translation)? Reason for asking is that I do not see any change...
MikeG621
Posts: 89
Joined: March 18th, 2013, 1:59 pm

Re: Screen rotation

Post by MikeG621 »

Part of the problem is the X/Y coordinates of the skin from your second monitor no longer exist once you've detached from the dock, not just the resolution changes. I've got two additional monitors plus the laptop screen at work, and if I were to put skins on the monitors and then detach, the skins don't know where to go. I get around this by never putting skins on removable screens, but I suppose you might be able to save different layouts for when you have the additional monitors and when you don't and have the skins use the built-in screen/work area variables so they adjust to the current monitor size. Just load the appropriate layout when your monitor situation changes.
maria_fj
Posts: 7
Joined: December 8th, 2013, 8:42 am

Re: Screen rotation

Post by maria_fj »

Hi,

Hm', perhaps I was not real clear in my question. I have a laptop to which a screen is attached. I disable the laptops screen and have everything on the standalone-screen. For RainMeter this is indicated as PrimaryScreen. When I detach the laptop from this standalone screen, then the PrimaryScreen is the laptops one, i.e. different resolution.

So, the one part is when I detach the laptop and the screen resolution changes. But screen resolution changes might happen as well with changes in the Windows-settings anyway. I cannot follow the arguments reg. off-screen-position, cause when I completely reload the complete theme, everything will be displayed properly. There aren't any OFF-screen.

The same issue applies for changes in screen orientation, e.g. Landscape => Horizontal. A complete reload of the skin positions everything (more or less) properly and that's it. The main question for me is, if there is a chance that RainMeter automatically reloads the current Skin completely as soon as the system tells him 'ScreenRes (resp. ScreenOrientation) changed'.

Could the reload be done automatically?

maria
FlyingHyrax
Posts: 232
Joined: July 1st, 2011, 1:32 am
Location: US

Re: Screen rotation

Post by FlyingHyrax »

This is not a great solution, but you could probably hack something together with Lua and some built in variables.

Rainmeter has many monitor related built-in variables. What you would need to do is have a script watch the value of the variable and fire an app refresh bang a skin refresh bang when it changes.
Kaelri wrote:Here's a simple way to make your script "watch" some value in the skin - for example, a variable - and take some action only on updates when the value has changed.

Code: Select all

function Initialize()
    Old = nil
end

function Update()
    local New = SKIN:GetVariable('SomeVar')
    if Old ~= New then
        -- do stuff
        Old = New
    end
end
Flying Hyrax on DeviantArt
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5534
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Screen rotation

Post by eclectic-tech »

bruce741 wrote:The same issue applies for changes in screen orientation, e.g. Landscape => Horizontal. A complete reload of the skin positions everything (more or less) properly and that's it. The main question for me is, if there is a chance that RainMeter automatically reloads the current Skin completely as soon as the system tells him 'ScreenRes (resp. ScreenOrientation) changed'.
This may help you (another JSMorley addon!) :thumbup:
FlyingHyrax
Posts: 232
Joined: July 1st, 2011, 1:32 am
Location: US

Re: Screen rotation

Post by FlyingHyrax »

To elaborate on my previous post, here is an example of a skin that refreshes itself when the screen resolution (specifically, the value of the SCREENAREAWIDTH variable) changes:

Skin:

Code: Select all

[Rainmeter]

[Metadata]
Name=ResChange
Author=Flying Hyrax | flyinghyrax.deviantart.com
Information=Example skin showing a simple way to automatically refresh a skin when screen resolution changes.
Version=1.0
License=CC BY-NC-SA 4.0 | http://creativecommons.org/licenses/by-nc-sa/4.0/

[Variables]

; see here for more built-in screen variables:
; http://docs.rainmeter.net/manual/variables/built-in-variables#MonitorVariables
; turn on verbosity by changing DbgOut to 1
[measureResChangeScript]
Measure=SCRIPT
ScriptFile=res-watcher.lua
Res=#SCREENAREAWIDTH#
DbgOut=0

[meterBackground]
Meter=IMAGE
X=0
Y=0
W=400
H=200
SolidColor=0,0,0,200

[meterSomeString]
Meter=STRING
X=200
Y=100
Text="An example! #SCREENAREAWIDTH#"
FontFace=Segoe UI
FontSize=16
FontColor=240,240,240
StringAlign=CENTERCENTER
AntiAlias=1
Dynamicvariables=1
Lua:

Code: Select all

-- "Detect Value Change" snippet from:
-- http://docs.rainmeter.net/snippets/detect-value-change
old, dbg = nil, false

function Initialize()
	old = SELF:GetNumberOption('Res')
	dbg = (SELF:GetNumberOption('DbgOut', 0) == 1 and true or false)
	if dbg then print ("res-watcher: initial value: " .. old) end
end

function Update()
	local new = SELF:GetNumberOption('Res')
	if old ~= new then
		old = new
		if dbg then print ("res-watcher: changed to " .. new) end
		SKIN:Bang('!Refresh')
	end
end
rmskin:
ResWatcherExample_1.0.rmskin
You do not have the required permissions to view the files attached to this post.
Flying Hyrax on DeviantArt