It is currently September 20th, 2019, 8:30 am

Skin doesn't update

Get help with installing and using Rainmeter.
Grmblfz
Posts: 12
Joined: December 25th, 2018, 8:25 pm

Skin doesn't update

Grmblfz » April 24th, 2019, 4:55 pm

Hey there,
I have a little program, which detects if an app is running or not. If it is active there is a box behind an icon (spotify), if not, the box should dissappear. However it doesn't. It updates when it recognizes that something is active but not if I close the programm. I made a test Meter (MeterText) and this does work, but the box is still visible.

Code: Select all

[Rainmeter]
Update=100

[Variables]
Color=1,1,1,1
Text=neither

[MeasureProcess]
Measure=Plugin
Plugin=Process
ProcessName=Spotify.exe
DynamicVariables=1

IfBelowValue=0
IfBelowAction=[!SetVariable Color "1,1,1,1"][!SetVariable Text 

"off"][!UpdateMeter MeterText][!UpdateMeter MeterShape]

IfAboveValue=0
IfAboveAction=[!SetVariable Color "1,1,1,150"][!SetVariable Text 

"on"][!UpdateMeter MeterText][!UpdateMeter MeterShape]

[MeterText]
Meter=String
Text=#Text#
FontSize=15
x=60
y=60
DynamicVariables=1

[MeterShape]
Meter=Shape
Shape=Rectangle 0,0,50,50,4 | FillColor #Color# | StrokeWidth 0
DynamicVariables=1

[MeterProcess]
Meter=Image
ImageName=#@#App\Spotify.png
W=50
H=50
DynamicVariables=1

MouseOverAction=[!SetOption MeterProcess W 60][!SetOption 

MeterProcess H 60][!UpdateMeter MeterProcess][!SetOption 

MeterShape Shape "Rectangle 0,0,60,60,4 | FillColor #Color# | 

StrokeWidth 0"][!UpdateMeter MeterShape]

MouseLeaveAction=[!SetOption MeterProcess W 50][!SetOption 

MeterProcess H 50][!UpdateMeter MeterProcess][!SetOption 

MeterShape Shape "Rectangle 0,0,50,50,4 | FillColor #Color# | 

StrokeWidth 0"][!UpdateMeter MeterShape]

LeftMouseUpAction=[C:\Users\Adrian\AppData\Roaming\Spotify

\Spotify.exe]
Any Tips?
User avatar
jsmorley
Developer
Posts: 19461
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Skin doesn't update

jsmorley » April 24th, 2019, 5:11 pm

Based on the code you have posted, it looks like whatever editor you are using has done "hard wraps" of lines that are longer than some amount. This can't be allowed to happen in Rainmeter, as options in a .ini file must always be one the same line. There cannot be linefeeds in any line in a .ini file.

If I fix this in your code, (and change to Notepad instead of Spotify, which I don't use) then it seems to work fine for me.

Code: Select all

[Rainmeter]
Update=1000

[Variables]
Color=1,1,1,1
Text=neither

[MeasureProcess]
Measure=Plugin
Plugin=Process
ProcessName=notepad.exe
IfBelowValue=0
IfBelowAction=[!SetVariable Color "1,1,1,150"][!SetVariable Text "off"][!UpdateMeter MeterText][!UpdateMeter MeterShape][!Redraw]
IfAboveValue=0
IfAboveAction=[!SetVariable Color "1,1,1,150"][!SetVariable Text "on"][!UpdateMeter MeterText][!UpdateMeter MeterShape][!Redraw]

[MeterText]
Meter=String
Text=#Text#
FontColor=255,255,255,255
FontSize=15
x=60
y=60
Antialias=1
DynamicVariables=1

[MeterShape]
Meter=Shape
Shape=Rectangle 0,0,50,50,4 | FillColor #Color# | StrokeWidth 0
DynamicVariables=1

[MeterProcess]
Meter=Image
ImageName=#@#App\Spotify.png
W=50
H=50
DynamicVariables=1
MouseOverAction=[!SetOption MeterProcess W 60][!SetOption MeterProcess H 60][!UpdateMeter MeterProcess][!SetOption MeterShape Shape "Rectangle 0,0,60,60,4 | FillColor #Color# | StrokeWidth 0"][!UpdateMeter MeterShape][!Redraw]
MouseLeaveAction=[!SetOption MeterProcess W 50][!SetOption MeterProcess H 50][!UpdateMeter MeterProcess][!SetOption MeterShape Shape "Rectangle 0,0,50,50,4 | FillColor #Color# | StrokeWidth 0"][!UpdateMeter MeterShape][!Redraw]
LeftMouseUpAction=[notepad]
The other thing I changed was to set the Update rate of the skin to the default 1000, and have actions that change meters not only update the meter(s), but !Redraw the skin. There is no need to hammer the skin with updates to make it visibly responsive to changes or mouse actions.
Grmblfz
Posts: 12
Joined: December 25th, 2018, 8:25 pm

Re: Skin doesn't update

Grmblfz » April 25th, 2019, 9:29 am

jsmorley wrote:
April 24th, 2019, 5:11 pm
Based on the code you have posted, it looks like whatever editor you are using has done "hard wraps" of lines that are longer than some amount. This can't be allowed to happen in Rainmeter, as options in a .ini file must always be one the same line. There cannot be linefeeds in any line in a .ini file.

If I fix this in your code, (and change to Notepad instead of Spotify, which I don't use) then it seems to work fine for me.

Code: Select all

IfBelowValue=0
IfBelowAction=[!SetVariable Color "1,1,1,1"][!SetVariable Text "off"][!UpdateMeter MeterText][!UpdateMeter MeterShape][!Redraw]
IfAboveValue=0
IfAboveAction=[!SetVariable Color "1,1,1,150"][!SetVariable Text "on"][!UpdateMeter MeterText][!UpdateMeter MeterShape][!Redraw]
The other thing I changed was to set the Update rate of the skin to the default 1000, and have actions that change meters not only update the meter(s), but !Redraw the skin. There is no need to hammer the skin with updates to make it visibly responsive to changes or mouse actions.
So, I changed the formating of the text so that everything is in line, but that didn't change anything.
Your code made the box visible at all times. However the box should dissappear when the program is closed.
The text "on"/"off" is just a test and shouldn't be there permanently.

So conclusion: The text does turn "off" and "on", but the box does not dissappear.

Even with notepad it doesn't work...

When it's on:
on.PNG
When it's off:
off.PNG
How it's supposed to look:
offcorrect.PNG
You do not have the required permissions to view the files attached to this post.
Grmblfz
Posts: 12
Joined: December 25th, 2018, 8:25 pm

Re: Skin doesn't update

Grmblfz » April 25th, 2019, 11:36 am

Finally got it to work! :yahoo: :party: :HamseterDancer

Code: Select all

[Rainmeter]
Update=1000

[Variables]
A=1

[MeasureProcess]
Measure=Plugin
Plugin=Process
ProcessName=Spotify.exe
DynamicVariables=1

IfBelowValue=0
IfBelowAction=[!SetVariable A "1"][!Update]

IfAboveValue=0
IfAboveAction=[!SetVariable A "150"][!Update]

[MeterShape]
Meter=Shape
Shape=Rectangle 0,0,50,50,4 | FillColor 1,1,1,#A# | StrokeWidth 0
W=60
H=60
DynamicVariables=1

[MeterProcess]
Meter=Image
ImageName=#@#App\Spotify.png
W=50
H=50
DynamicVariables=1

MouseOverAction=[!SetOption MeterProcess W 60][!SetOption MeterProcess H 60][!SetOption MeterShape Shape "Rectangle 0,0,60,60,4 | FillColor 1,1,1,#*A*# | StrokeWidth 0"][!Update]

MouseLeaveAction=[!SetOption MeterProcess W 50][!SetOption MeterProcess H 50][!SetOption MeterShape Shape "Rectangle 0,0,50,50,4 | FillColor 1,1,1,#*A*# | StrokeWidth 0"][!Update]

LeftMouseUpAction=[C:\Users\Adrian\AppData\Roaming\Spotify\Spotify.exe]
There was a problem in this line:

Code: Select all

MouseOverAction=[!SetOption MeterProcess W 60][!SetOption MeterProcess H 60][!SetOption MeterShape Shape "Rectangle 0,0,60,60,4 | FillColor 1,1,1,#*A*# | StrokeWidth 0"][!Update]

MouseLeaveAction=[!SetOption MeterProcess W 50][!SetOption MeterProcess H 50][!SetOption MeterShape Shape "Rectangle 0,0,50,50,4 | FillColor 1,1,1,#*A*# | StrokeWidth 0"][!Update]
When I would set the "" The Variable wouldn't be recognized, when I didn't set the "" the variable would get recognized but therefore the shape wouldn't be changed. So I embeded the Variable so that it would be given to the [MeterShape] as literal, and this worked then.

In addition I deleted the [MeterText] and added the W=60 and H=60 in [MeterShape] so that you could actually see, that it would expand (otherwise the width and height would be 50 due to the image size).

Sometimes Frustration gets you where you want to end up :17angry .

I will add a varable.ini and replace the Spotify.exe with #program# and the path with #path# and the image with #img# so that you could set as many different programs and stuff as you want.

Any tips where to release the final skin?