SilverAzide / Gadgets

Gadgets for Rainmeter
Other
365 stars 12 forks source link

Drives Meter: Can you modify DiskThresholdFull and Warn? #46

Closed derinsh0 closed 2 years ago

derinsh0 commented 2 years ago

I've tried to modify the ini to lower the Full threshold from 10% to 5% free to make the drive not show a red bar. I've had no success.

SilverAzide commented 2 years ago

Yes, you can! It is simple, no need to edit the skin!

Open the variables file for the Drives Meter in the @Resources folder. For a typical installation, it is the C:\Users\<username>\Documents\Rainmeter\Gadgets\@Resources\DrivesVariables.inc file.

A few lines down from the top are a set of variables that control the threshold values for the "warning" (yellow color) and "disk full" (red color) values.

; disk warning threshholds
DiskThreshholdFull=0.90
DiskThreshholdWarn=0.80

Just change these values to whatever you like (1.00 = 100%). So in your case, just set the DiskThreshholdFull value to 0.95 and you are good to go. (Don't forget the leading zero before the decimal; Rainmeter chokes if you leave it out.) Sorry for not putting this in the Settings skin, but it was getting so large I decided to leave it out to save space.

derinsh0 commented 2 years ago

That was quick!

And it worked, thank you. With larger drives >1 TB it's a nice thing to change this. I also learned how # variables work.

SilverAzide commented 2 years ago

LOL! Yes, I did exactly what you did for my own Gadgets install. I've been trying to think up a way to make this threshold value "scale" somehow depending on the size of the drive. There's a massive difference between a 256GB drive that's 90% full and a 8TB drive that's 90% full. 😃

derinsh0 commented 2 years ago

LOL! Yes, I did exactly what you did for my own Gadgets install. I've been trying to think up a way to make this threshold value "scale" somehow depending on the size of the drive. There's a massive difference between a 256GB drive that's 90% full and a 8TB drive that's 90% full. 😃

Yeah it's funny. Like being warned when 500gb is left when some PCs don't even have that.

But it's a great idea to scale. I don't know enough about how Rainmeter scripting works, but it seems values are evaluated when the skin is loaded or refreshed. Either way I think 50 or 100GB is good threshold for large drives.

So if I understand correctly, either a constant variable such as 50 then evaluating a new threshold factor in the main script from DiskSpaceTotal i.e

DiskThreshholdFullA = 1-(MeasureDiskSpaceTotalA/50)

or somehow skipping percentages and going directly off MeasureDiskSpaceTotalA here: (might clog it up checking if drive is >1T)

[MeasureDiskPercentFullA]
...
IfCondition=(MeasureDiskPercentFullA >= #DiskThreshholdFull#)
IfTrueAction=[!SetOption BarMeterDiskA BarColor "#ColorBarFull#"]

Or maybe you wanted to spice it up with logarithmic scales :)

SilverAzide commented 2 years ago

Ooo! Logarithms! 😍