For those who aren't aware, Rainy added the following global variables to Rainmeter in a release a few days ago:
In the past, if your users wanted to change the width of something, they had to open a window full of scary code and find the appropriate line. We shall hereafter refer to these as the Dark Ages of Rainmeter. Now my Taskbar skin, for example, is nothing more than this:#SCREENAREAHEIGHT#
#SCREENAREAWIDTH#
#WORKAREAWIDTH#
#WORKAREAHEIGHT#
#WORKAREAX#
#WORKAREAY#
Code: Select all
[Taskbar]
Meter=IMAGE
ImageName=Taskbar.jpg
W=#WORKAREAWIDTH#
H=33
Code: Select all
W=(#WORKAREAWIDTH# / 3)
Placing a skin relative to the top or left sides of the desktop area is effortless - (#WORKAREAX# + X) or (#WORKAREAY# + Y). The right or bottom sides are a bit tricker, but just as effective. For example, if I want the Taskbar to be 33 pixels from the bottom - since it's 33 pixels high - I'd type
Code: Select all
WindowY=(#WORKAREAY# + (#WORKAREAHEIGHT# - 33))
Centering a skin is just as easy. It's a tad more complicated in that you can't just make X and Y the center of the screen - the skin has its own height and width, remember. With Enigma, I've kept a consistent format for all of my "Taskbar" skins, in which the text is center-aligned at X=60. So if I wanted to center the whole skin as part of a theme, I'd use this format:
Code: Select all
WindowX=((#SCREENAREAWIDTH# / 2) - 60)
Code: Select all
[Rainmeter]
TrayExecuteDL=!execute [!RainmeterActivateConfig "Enigma\_Home" "Home.ini"]
[Enigma\_Home]
Active=1
WindowX=(#WORKAREAX# + (#WORKAREAWIDTH# - 900) / 2)
WindowY=(#WORKAREAY# + (#WORKAREAHEIGHT# - 600) / 2)
[Enigma\Taskbar\_Taskbar]
WindowX=(#WORKAREAX#)
WindowY=(#WORKAREAY# + (#WORKAREAHEIGHT# - 33))
AlphaValue=127
FadeDuration=250
ClickThrough=0
Draggable=1
HideOnMouseOver=0
SavePosition=1
SnapEdges=0
KeepOnScreen=1
AlwaysOnTop=-1
Active=3
[Enigma\Sidebar\_Sidebar]
Active=2
WindowX=(#WORKAREAX# + (#WORKAREAWIDTH# - 214))
WindowY=(#WORKAREAY#)
AlphaValue=76
FadeDuration=250
ClickThrough=0
Draggable=1
HideOnMouseOver=0
SavePosition=1
SnapEdges=0
KeepOnScreen=1
AlwaysOnTop=-1
[Enigma\Sidebar\Clock]
Active=4
WindowX=(#WORKAREAX# + (#WORKAREAWIDTH# - 283))
WindowY=(#WORKAREAY#)
AlphaValue=255
FadeDuration=250
ClickThrough=0
Draggable=1
HideOnMouseOver=0
SavePosition=1
SnapEdges=0
KeepOnScreen=1
AlwaysOnTop=0
[Enigma\Sidebar\Music]
WindowX=(#WORKAREAX# + (#WORKAREAWIDTH# - 195))
WindowY=(#WORKAREAY# + (#WORKAREAHEIGHT# - 115))
AlphaValue=255
FadeDuration=250
ClickThrough=0
Draggable=1
HideOnMouseOver=0
SavePosition=1
SnapEdges=1
KeepOnScreen=1
AlwaysOnTop=0
Active=2
[Enigma\Sidebar\Notes]
Active=2
WindowX=(#WORKAREAX# + (#WORKAREAWIDTH# - 188))
WindowY=(#WORKAREAY# + 110)
AlphaValue=255
FadeDuration=250
ClickThrough=0
Draggable=1
HideOnMouseOver=0
SavePosition=1
SnapEdges=0
KeepOnScreen=0
AlwaysOnTop=0
[Enigma\Taskbar\Combos\Tray Systems]
Active=1
WindowX=(#WORKAREAX# + (#WORKAREAWIDTH# - 253))
WindowY=(#WORKAREAY# + (#WORKAREAHEIGHT# - 28))
AlphaValue=255
FadeDuration=250
ClickThrough=0
Draggable=1
HideOnMouseOver=0
SavePosition=1
SnapEdges=0
KeepOnScreen=1
AlwaysOnTop=0