It is currently April 27th, 2024, 1:15 pm

How do I edit MappleWood code in order for Uptime to reflect time since login?

Get help with creating, editing & fixing problems with skins
litnomad
Posts: 1
Joined: March 21st, 2024, 10:31 pm

How do I edit MappleWood code in order for Uptime to reflect time since login?

Post by litnomad »

https://www.deviantart.com/mnhshare/art/MappleWood-1-1-2-359834476

The time skin is supposed to reflect how long I've been on the computer but sometimes doesn't reset after I restart Windows 10 so I am trying to modify the code to fix this issue. See https://docs.rainmeter.net/manual/measures/uptime/. But I'm a newbie and can't get it to work.

Original:
Troubleshoot1.png

Code: Select all

[Rainmeter]
Author=Tyler J. Colby-Wolter
Update=1000
BackgroundMode=1

[Metadata]
Name=Flat | Uptime
Config=Flat | Uptime
Description=This skin shows your uptime
Version=1.0
Tags=Uptime
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

[MeasureUptime]
Measure=Uptime
Substitute="d":" days,",":":" hours, "

[MeterUptime]
Meter=String
MeasureName=MeasureUptime
X=0
Y=0
FontColor=255,255,255,230
FontFace=Calibri
FontSize=15
PostFix=" minutes"
AntiAlias=1

Modified Code:

Code: Select all

[Rainmeter]
Author=Tyler J. Colby-Wolter
Update=1000
BackgroundMode=1

[Metadata]
Name=Flat | Uptime
Config=Flat | Uptime
Description=This skin shows your uptime
Version=1.0
Tags=Uptime
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

[MeasureCurrentTime]
Measure=Time

[MeasureUserLoginTime]
Measure=Plugin
Plugin=SysInfo
SysInfoType=USER_LOGONTIME
UpdateDivider=-1

[MeasureFormatSeconds]
Measure=UpTime
SecondsValue=([MeasureCurrentTime:] - [MeasureUserLoginTime:])
Format=Format="%4!i! days, %3!i! hours, %2!i! minutes %1!i! seconds"
DynamicVariables=1

[MeterUptime]
Meter=String
MeasureName=UpTime
FontSize=12
FontColor=255,255,255,255
SolidColor=0,0,0,0
Padding=5,5,5,5
AntiAlias=1
Text="minutes"
Result:

No time is reflected and it just says minutes.
Troubleshoot.png
You do not have the required permissions to view the files attached to this post.
RicardoTM
Posts: 268
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: How do I edit MappleWood code in order for Uptime to reflect time since login?

Post by RicardoTM »

litnomad wrote: March 21st, 2024, 10:51 pm
Modified Code:

Code: Select all


Format=Format="%4!i! days, %3!i! hours, %2!i! minutes %1!i! seconds"
You have format twice there
User avatar
SilverAzide
Rainmeter Sage
Posts: 2611
Joined: March 23rd, 2015, 5:26 pm

Re: How do I edit MappleWood code in order for Uptime to reflect time since login?

Post by SilverAzide »

litnomad wrote: March 21st, 2024, 10:51 pm https://www.deviantart.com/mnhshare/art/MappleWood-1-1-2-359834476

The time skin is supposed to reflect how long I've been on the computer but sometimes doesn't reset after I restart Windows 10 so I am trying to modify the code to fix this issue. See https://docs.rainmeter.net/manual/measures/uptime/. But I'm a newbie and can't get it to work.

No time is reflected and it just says minutes.
In addition to RicardoTM's comment, you kind of mangled the meter MeterUptime when you changed it. You might want to read the docs about String meters. Try this instead:

Code: Select all

...

[MeasureFormatSeconds]
Measure=UpTime
SecondsValue=([MeasureCurrentTime:TimeStamp] - [MeasureUserLoginTime:TimeStamp])
Format="%4!i! days, %3!i! hours, %2!i! minutes, %1!i! seconds"
DynamicVariables=1

[MeterUptime]
Meter=String
MeasureName=MeasureFormatSeconds
FontSize=12
FontColor=255,255,255,255
SolidColor=0,0,0,0
Padding=5,5,5,5
AntiAlias=1
Text="%1"
Gadgets Wiki GitHub More Gadgets...