It is currently May 6th, 2024, 11:44 pm

Always show disk space in GB

Get help with creating, editing & fixing problems with skins
Grantp
Posts: 82
Joined: November 29th, 2010, 5:28 pm

Always show disk space in GB

Post by Grantp »

Hi All,

I have 3 x 3TB hard drives. I would like to display my Total / Used / Free disk space in GB rather than TB. The Total space is easy just multiply Total by 1024, but i don't know how to do this with Used and Free. If Free is down to 350GB I dont want to be multiplying by 1024. So I suppose my question is how do I get RM to check the returned units (TB/GB/MB) then do the calculation to convert to GB if required.

I hope this makes sence. Any help would be greatly appreciated.

Cheers Grant
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Always show disk space in GB

Post by jsmorley »

FreeDiskSpace actually returns the value in Bytes, so if you just don't use AutoScale= on your meter, you can control the level of granularity yourself with Calc measures.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[MeasureLabelDrive1]
Measure=FreeDiskSpace
Drive=C:
Label=1
IgnoreRemovable=0
UpdateDivider=2

[MeasureTotalDrive1]
Measure=FreeDiskSpace
Drive=C:
Total=1
IgnoreRemovable=0
UpdateDivider=2
[TotalGigs]
Measure=Calc
Formula=(MeasureTotalDrive1/1073741824)

[MeasureFreeDrive1]
Measure=FreeDiskSpace
Drive=C:
IgnoreRemovable=0
UpdateDivider=2
[FreeGigs]
Measure=Calc
Formula=(MeasureFreeDrive1/1073741824)

[MeasureUsedDrive1]
Measure=FreeDiskSpace
Drive=C:
InvertMeasure=1
IgnoreRemovable=0
UpdateDivider=2
[UsedGigs]
Measure=Calc
Formula=(MeasureUsedDrive1/1073741824)

[MeterOne]
Meter=String
MeasureName=MeasureLabelDrive1
MeasureName2=TotalGigs
MeasureName3=FreeGigs
MeasureName4=UsedGigs
FontSize=12
FontColor=255,255,255,255
Antialias=1
NumOfDecimals=1
Text=%1 : %2 GB | %3 GB | %4 GB
http://www.t1shopper.com/tools/calculate/
Grantp
Posts: 82
Joined: November 29th, 2010, 5:28 pm

Re: Always show disk space in GB

Post by Grantp »

Thankyou. As usual very prompt and informative help.

It worked perfectly for me.

Thanks Grant