It is currently March 29th, 2024, 1:28 pm

Gadgets 7.6.0 - inspired by AddGadgets.com Sidebar Gadgets

A package of skins with a "theme" or by a single author
User avatar
raiguard
Posts: 660
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Re: Gadgets 3.0.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by raiguard »

9elsen wrote:Thanks for making these nice AddGadget monitors

I have used them since they were originally made for Windows 7 I think.

I have just loaded the latest rainmeter beta, and your latest AddGadgets.

But the Drives meter shows 100% load on all drives. I can not seem to find out how to fix this.

Is HWiNFO needed for this. Did not use that in an older version.

Have you seen this before?
The PerfMon database has been corrupted. Open cmd.exe as administrator and type in the following, in order:

Code: Select all

cd c:\windows\system32
lodctr /R
cd c:\windows\sysWOW64
lodctr /R
You should then see this:

Code: Select all

Info: Successfully rebuilt performance counter setting from system backup store
After you do this, refresh Drives Meter and it should be working properly.
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Gadgets 3.0.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by jsmorley »

So to test for both the existence of quser.exe and the default US-English locale for date and time, I might use:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
OnRefreshAction=[!CommandMeasure MeasureUserLoginTime "Run"]

[MeasureCurrentTime]
Measure=Time

[MeasureUpTime]
Measure=UpTime
Format="%4!i!d %3!i!h %2!i!m"

[MeasureGetUserName]
Measure=Plugin
Plugin=SysInfo
SysInfoType=USER_NAME
UpdateDivider=-1

[MeasureUserLoginTime]
Measure=Plugin
Plugin=RunCommand
Parameter=quser "[MeasureGetUserName]"
State=Hide
OutputType=ANSI
DynamicVariables=1
RegExpSubstitute=1
Substitute="(?si).*  (.*)$":"\1","#CRLF#":""
FinishAction=[!EnableMeasureGroup UserTimes]

[MeasureCheckQUSER]
Measure=String
Group=UserTimes
String=[MeasureUserLoginTime]
DynamicVariables=1
Disabled=1
; Standard US-Eng Locale is like 8/4/2017 10:23 AM
IFMatch=(?s)[\d]{1,2}/[\d]{1,2}/[\d]{4} [\d]{1,2}:[\d]{1,2} AM|PM
IfMatchAction=[!EnableMeasureGroup UserTimes][!SetOption MeterUserLogin MeasureName "MesureParseSeconds"]
IfNotMatchAction=[!DisableMeasureGroup UserTimes][!SetOption MeterUserLogin MeasureName "MeasureUpTime"]

[MeasureUserFormat]
Measure=Time
Group=UserTimes
TimeStamp=[MeasureUserLoginTime]
TimeStampFormat=%#m/%#d/%Y %#I:%M %p
Format=%a, %b %#d - %#I:%M %p
DynamicVariables=1
Disabled=1

[MeasureUserDiff]
Measure=Time
Group=UserTimes
TimeStamp=([MeasureCurrentTime:timestamp] - [MeasureUserFormat:timestamp])
DynamicVariables=1
Disabled=1

[MesureParseSeconds]
Measure=UpTime
Group=UserTimes
SecondsValue=[MeasureUserDiff:timestamp]
Format="%4!i!d %3!i!h %2!i!m"
Disabled=1
DynamicVariables=1

[MeterUpTimeText]
Meter=String
X=15
Y=2R
StringAlign=Left
FontSize=10
FontColor=255,255,255,255
AntiAlias=1
Text=System

[MeterUpTime]
MeasureName=MeasureUpTime
Meter=String
X=154
Y=0r
StringAlign=Right
FontSize=10
FontColor=255,255,255,255
AntiAlias=1

[MeterUserLoginText]
Meter=String
X=15
Y=2R
StringAlign=Left
FontSize=10
FontColor=255,255,255,255
StringCase=Proper
AntiAlias=1
DynamicVariables=1
Text=[MeasureGetUserName]

[MeterUserLogin]
Meter=String
MeasureName=MesureParseSeconds
X=154
Y=0r
StringAlign=Right
FontSize=10
FontColor=255,255,255,255
AntiAlias=1
So basically, if anything goes wrong, if quser.exe isn't found, or the date / time string returned can't be correctly parsed, then it just says "forget it" and switches to showing the value for Uptime instead.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: Gadgets 3.0.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by SilverAzide »

Ayn Rand wrote:If it's worth doing, it's worth overdoing.
OK, so after investing WAY too much time for a very tiny return, here is my cut at it using the inestimable jsmorley's template.

This should (fingers crossed) automatically derive the proper date/time format string from your registry to properly parse the date from the QUSER command, and if the QUSER command fails, the code should default to using the current time instead of the session time. Note: This works only on Windows 7 and later due to the Windows "sShortTime" registry setting not being available in XP/Vista.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
BackgroundMode=2
SolidColor=0,0,0
DynamicWindowSize=1
OnRefreshAction=[!CommandMeasure MeasureUserLoginTime "Run"]

[Variables]
FmtShortDate=""
FmtShortTime=""

; sShortDate = "M/d/yyyy"
;   yyyyy = 5-digit year (00001-99999)
;   yyyy = 4-digit year (0001-9999)
;   yyy  = 3-digit year (001-9999)
;   yy   = 2-digit year (01-99)
;   y    = 1-digit year (1-99)
;   MM   = month number, leading zero (01-12)
;   M    = month number, no leading zero (1-12)
;   dd   = day number, leading zero (01-31)
;   d    = day number, no leading zero (1-31)
;
[MeasureShortDate]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Control Panel\International
RegValue=sShortDate
Substitute="y":"@","@@@@@":"%Y","@@@@":"%Y","@@@":"%y","@@":"%y","@":"%#y","M":"@","@@":"%m","@":"%#m","d":"@","@@":"%d","@":"%#d"
IfCondition=1
IfTrueAction=[!SetVariable FmtShortDate "[MeasureShortDate]"]
UpdateDivider=-1

; sShortTime  = "h:mm tt"  (not available in XP/Vista)
;   HH = hour, zero-based 24-hour, leading zero (00-23)
;   H  = hour, zero-based 24-hour, no leading zero (0-23)
;   hh = hour, 12-hour, leading zero (01-12)
;   h  = hour, 12-hour, no leading zero (1-12)
;   mm = minute, leading zero (00-59)
;   m  = minute, no leading zero (0-59)
;   ss = seconds, leading zero (00-59)
;   s  = seconds, no leading zero (0-59)
;   tt = AM/PM designator
;   t  = abbreviated AM/PM designator (A/P)
;
[MeasureShortTime]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Control Panel\International
RegValue=sShortTime
Substitute="H":"@","@@":"%H","@":"%#H","h":"@","@@":"%I","@":"%#I","m":"@","@@":"%M","@":"%#M","s":"@","@@":"%S","@":"%#S","t":"@","@@":"%p","@":"%p"
IfCondition=1
IfTrueAction=[!SetVariable FmtShortTime "[MeasureShortTime]"]
UpdateDivider=-1

[MeasureCurrentTime]
Measure=Time

[MeasureUpTime]
Measure=UpTime
Format="%4!i!d %3!i!h %2!i!m %1!i!s"

[MeasureGetUserName]
Measure=Plugin
Plugin=SysInfo
SysInfoType=USER_NAME
UpdateDivider=-1

[MeasureUserLoginTime]
Measure=Plugin
Plugin=RunCommand
Parameter=quser "[MeasureGetUserName]"
State=Hide
OutputType=ANSI
DynamicVariables=1
RegExpSubstitute=1
Substitute="(?si).*  (.*)$":"\1","#CRLF#":"","'":""
FinishAction=[!EnableMeasureGroup UserTimes]

[MeasureCheckQUSER]
Measure=String
Group=UserTimes
String=[MeasureUserLoginTime]
DynamicVariables=1
Disabled=1
IfMatch=^$
IfMatchAction=[!DisableMeasureGroup UserTimes][!SetOption MeterUserLogin MeasureName "MeasureUpTime"]
IfNotMatchAction=[!EnableMeasureGroup UserTimes][!SetOption MeterUserLogin MeasureName "MeasureParseSeconds"]

[MeasureUserFormat]
Measure=Time
Group=UserTimes
TimeStamp=[MeasureUserLoginTime]
TimeStampFormat="#FmtShortDate# #FmtShortTime#"
Format="#FmtShortDate# #FmtShortTime#"
DynamicVariables=1
Disabled=1

[MeasureUserDiff]
Measure=Time
Group=UserTimes
TimeStamp=([MeasureCurrentTime:timestamp] - [MeasureUserFormat:timestamp])
DynamicVariables=1
Disabled=1

[MeasureParseSeconds]
Measure=UpTime
Group=UserTimes
SecondsValue=[MeasureUserDiff:timestamp]
Format="%4!i!d %3!i!h %2!i!m %1!i!s"
Disabled=1
DynamicVariables=1

[MeterUpTimeText]
Meter=String
X=15
Y=2R
StringAlign=Left
FontSize=10
FontColor=255,255,255,255
AntiAlias=1
Text=System

[MeterUpTime]
MeasureName=MeasureUpTime
Meter=String
X=164
Y=0r
StringAlign=Right
FontSize=10
FontColor=255,255,255,255
AntiAlias=1

[MeterUserLoginText]
Meter=String
X=15
Y=2R
StringAlign=Left
FontSize=10
FontColor=255,255,255,255
StringCase=Proper
AntiAlias=1
DynamicVariables=1
Text=[MeasureGetUserName]

[MeterUserLogin]
Meter=String
MeasureName=MeasureParseSeconds
X=164
Y=0r
StringAlign=Right
FontSize=10
FontColor=255,255,255,255
AntiAlias=1
A patch to the Gadgets will be forthcoming! Thanks everyone! :thumbup:
Gadgets Wiki GitHub More Gadgets...
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Gadgets 3.0.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by jsmorley »

SilverAzide wrote:OK, so after investing WAY too much time for a very tiny return, here is my cut at it using the inestimable jsmorley's template.
Well, if you are going to go all out, there is what I think is a simpler way...
UptimeDual_1.0.rmskin
1.jpg
UptimeDual.ini:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
OnRefreshAction=[!CommandMeasure MeasureUserLoginTime "Run"]

[MeasureCurrentTime]
Measure=Time

[MeasureUpTime]
Measure=UpTime
Format="%4!i!d %3!i!h %2!i!m"

[MeasureGetUserName]
Measure=Plugin
Plugin=SysInfo
SysInfoType=USER_NAME
UpdateDivider=-1

[MeasureUserLoginTime]
Measure=Plugin
Plugin=RunCommand
Parameter=quser "[MeasureGetUserName]"
State=Hide
OutputType=ANSI
DynamicVariables=1
RegExpSubstitute=1
FinishAction=[!EnableMeasure MeasureCheckQuser][!UpdateMeasure MeasureCheckQuser]

[MeasureCheckQuser]
Measure=Script
ScriptFile=UptimeDual.lua
Disabled=1
UpdateDivider=-1
IfCondition=MeasureCheckQuser = -1
IfTrueAction=[!DisableMeasureGroup UserTimes][!SetOption MeterUserLogin MeasureName "MeasureUpTime"] 
IfFalseAction=[!EnableMeasureGroup UserTimes][!UpdateMeasureGroup UserTimes][!SetOption MeterUserLogin MeasureName "MesureParseSeconds"] 

[MeasureUserFormat]
Measure=Time
Group=UserTimes
TimeStamp=[MeasureCheckQuser]
TimeStampFormat=%m/%d/%Y %I:%M %p
Format=%a, %b %d - %I:%M %p
DynamicVariables=1
Disabled=1

[MeasureUserDiff]
Measure=Time
Group=UserTimes
TimeStamp=([MeasureCurrentTime:timestamp] - [MeasureUserFormat:timestamp])
DynamicVariables=1
Disabled=1

[MesureParseSeconds]
Measure=UpTime
Group=UserTimes
SecondsValue=[MeasureUserDiff:timestamp]
Format="%4!i!d %3!i!h %2!i!m"
Disabled=1
DynamicVariables=1

[MeterUpTimeText]
Meter=String
X=0
Y=0
StringAlign=Left
FontSize=10
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
Text=System

[MeterUpTime]
MeasureName=MeasureUpTime
Meter=String
X=154
Y=0r
StringAlign=Right
FontSize=10
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1

[MeterUserLoginText]
Meter=String
X=0
Y=2R
StringAlign=Left
FontSize=10
FontColor=255,255,255,255
SolidColor=0,0,0,1
StringCase=Proper
AntiAlias=1
DynamicVariables=1
Text=[MeasureGetUserName]

[MeterUserLogin]
Meter=String
MeasureName=MesureParseSeconds
X=154
Y=0r
StringAlign=Right
FontSize=10
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
UptimeDual.lua:

Code: Select all

function Initialize()

	dofile(SKIN:GetVariable('@')..'DateLib\\date.lua')
	
	measureQuser = SKIN:GetMeasure('MeasureUserLoginTime')

end

function Update()

	rawString = measureQuser:GetStringValue()
	
	dateString = string.match(rawString, '.*>.+Active[%s]*none[%s]*(.*)\n')
	
	if dateString then
		return(date(dateString):fmt('%m/%d/%Y %I:%M %p'))
	else
		return -1
	end

end
So what I am doing...

In the skin:

Use RunCommand to get the results of quser.exe as before, but don't do any Substitute, just get the entire raw value.

When that is done, use FinishAction to execute the Lua script.
FinishAction=[!EnableMeasure MeasureCheckQuser][!UpdateMeasure MeasureCheckQuser]

In the Lua:

In Initialize() load the included date.lua library as a dofile()

Get the value of the RunCommand measure as a string.

Parse the string using string.match() to get the date and time at the end. The system locale, the format of this date and time, DOESN'T MATTER. Trust me, the date.lua library will figure it out, and create a "date object".

If a valid date object is created, then return that to the skin, with formatting to turn it into a particular date and time format that we can react to in the skin.
return(date(dateString):fmt('%m/%d/%Y %I:%M %p'))

If a valid date object is not created, which would be the case if quser.exe is missing, then just return -1.

Back in the skin:

Use IfCondition to test for a numeric return of -1 on the Script measure.
IfCondition=MeasureCheckQuser = -1

If it is -1, then bail out and use the system Uptime.

If it is not -1 (which means it will be our formatted string) then do all the "difference from now" and all that as we did before and format the results using the Uptime formatting.

=================

As I said, the date.lua library is included with this .rmskin. Use that. There are other versions floating around on the web, but this is the one that works with our Rainmeter / Lua interface.

The documentation for date.lua is at:
http://tieske.github.io/date/

It is a VERY powerful date and time handler, and I highly recommend it.

On the other hand, just USE it, the documentation is pretty good. Don't even open data.lua in a text editor, it will send you running away screaming. You don't have to understand the library code, it's just a black box.
You do not have the required permissions to view the files attached to this post.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: Gadgets 3.0.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by SilverAzide »

Sweet! :thumbup:
Since this uses the Rainmeter 4.x "dofile" functionality, I will use this method once I finally drop support for Rainmeter 3.3.x.
Gadgets Wiki GitHub More Gadgets...
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Gadgets 3.0.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by jsmorley »

SilverAzide wrote:Sweet! :thumbup:
Since this uses the Rainmeter 4.x "dofile" functionality, I will use this method once I finally drop support for Rainmeter 3.3.x.
Why in the world would you ever support anything older than the latest "release" version. I'm opposed to that in principle, as it encourages bad behavior.

Edit: Oh, XP support. Meh, I still oppose it in principle... Screw XP. ;-)
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: Gadgets 3.0.1 - inspired by AddGadgets.com Sidebar Gadgets

Post by SilverAzide »

A minor update to the Gadgets suite has been released. There were a couple of showstopper bugs in the new Digital Clock gadget, which have been corrected in this release.

For Gadgets 3.0.1:
  • Corrected several errors/issues in Digital Clock gadget.
  • Enhanced Analog Clock gadget to support chimes and alarms.
  • Corrected Drives Meter display issues that affected drives L:-Z:.
  • Updated RainRGB add-on to current version.
Get it on DeviantART: http://fav.me/d8n4kvx
Gadgets Wiki GitHub More Gadgets...
9elsen
Posts: 2
Joined: August 4th, 2017, 2:48 pm

Re: Gadgets 3.0.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by 9elsen »

raiguard wrote:The PerfMon database has been corrupted. Open cmd.exe as administrator and type in the following, in order:

Code: Select all

cd c:\windows\system32
lodctr /R
cd c:\windows\sysWOW64
lodctr /R
You should then see this:

Code: Select all

Info: Successfully rebuilt performance counter setting from system backup store
After you do this, refresh Drives Meter and it should be working properly.
Thanks, it worked, I had to boot though before it worked. :thumbup:
Area51
Posts: 24
Joined: October 15th, 2016, 3:03 pm

Re: Gadgets 3.0.1 - inspired by AddGadgets.com Sidebar Gadgets

Post by Area51 »

I'm using Gadgets 3.0.1 and HWinfo 5.55-3220 and I'm having a problem with temperatures on the CPU gadget and fan and temps on the GPU gadget. I was running version 2.20 of Gadgets and about 2 versions ago after an HWinfo update all of the above readings stopped working. I had them working well for over a year, and all of a sudden the update and boom, some readings stopped working. I have installed the 3.0.1 version of Gadgets and the latest HWinfo beta too, but no dice on the readings starting to work again. I tried downgrading Gadgets all the way back to 2.20 and HWinfo to the release version that was working, but nothing fixed the readings issue. When I upgraded HWinfo, I did not replace the ini file as I have done many times when upgrading it before. CPU is an AMD FX-8350 and the GPU is an HD-7900 Radeon.

I can launch HWinfo and take a look at the sensors window and the readings are really there; it's seeing them. But Gadgets doesn't. Sensors is running and minimized and HWinfo starts with Windows, but even with the fulls set of HWinfo windows open, nothing displays, so it can't be that something isn't running i don't think. I do see that the older version or CPU meter has an ini file for HWinfo, but now there is only one ini file.

I'm looking for troubleshooting ideas to get the readings working again, but have run out of ideas to try. Any ideas would be appreciated :)
Milamber33
Posts: 12
Joined: October 31st, 2015, 6:30 pm

Re: Gadgets 3.0.1 - inspired by AddGadgets.com Sidebar Gadgets

Post by Milamber33 »

Just eliminating the obvious, have you checked that the gadget is still configured with the correct details for HWinfo?