It is currently May 5th, 2024, 2:31 am

About FreeDiskSpace tool

Report bugs with the Rainmeter application and suggest features.
lunary
Posts: 6
Joined: August 7th, 2011, 3:10 pm

About FreeDiskSpace tool

Post by lunary »

It's a useful tool for many people,,,,,

If it could hide the removable devices' titles when we disconnect them?

now it shows 0 there...I can not use that space to set other tool
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: About FreeDiskSpace tool

Post by Kaelri »

You can do this right now. Here's what I use in my skins to differentiate present and removed drives:

Code: Select all

[MeasureDrive]
Measure=FreeDiskSpace
Drive=C:
IfAboveValue=0
IfAboveAction=!SetOption "StringMeter" "Text" "%1"
IfEqualValue=0
IfEqualAction=!SetOption "StringMeter" "Text" "Removed"
The "IfAboveAction" and "IfEqualAction" can do anything you want them to: change text, hide meters, move meters, or whatever else you can think of.
lunary
Posts: 6
Joined: August 7th, 2011, 3:10 pm

Re: About FreeDiskSpace tool

Post by lunary »

I tried it

But the number always shows 0

If you could help me write a full tool.... :(
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: About FreeDiskSpace tool

Post by Kaelri »

Can you show me your skin as it exists now?
lunary
Posts: 6
Joined: August 7th, 2011, 3:10 pm

Re: About FreeDiskSpace tool

Post by lunary »

This is the code

Code: Select all

[Rainmeter]
Update=1000

[Variables]
fontName=Trebuchet MS
textSize=8
colorBar=235,170,0,255
colorText=255,255,255,205
disk1=H:

[measureTotalDisk1]
; This measure returns the total disk space
Measure=FreeDiskSpace
Drive=#disk1#
Total=1
UpdateDivider=120

[measureUsedDisk1]
; Returns inverted value of free disk space (i.e. used disk space)
Measure=FreeDiskSpace
Drive=#disk1#
InvertMeasure=1
UpdateDivider=120

; ----------------------------------
; STYLES are used to "centralize" options
; ----------------------------------

[styleTitle]
StringAlign=CENTER
StringCase=UPPER
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#fontName#
FontSize=10
AntiAlias=1
ClipString=1

[styleLeftText]
StringAlign=LEFT
; Meters using styleLeftText will be left-aligned.
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleRightText]
StringAlign=RIGHT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleBar]
BarColor=#colorBar#
BarOrientation=HORIZONTAL
SolidColor=255,255,255,15

; ----------------------------------
; METERS display images, text, bars, etc.
; ----------------------------------

[meterBackground]
Meter=IMAGE
ImageName=#SKINSPATH#\illustro\SHARED\Background1Line.png
; #SKINSPATH# is a global variable that stands for your skin path. It is
; usually Documents\Rainmeter\Skins.
X=0
Y=0

[meterTitle]
Meter=STRING
MeterStyle=styleTitle
; Using MeterStyle=styleTitle will basically "copy" the
; contents of the [styleTitle] section here during runtime.
X=100
Y=12
W=190
H=18
Text="Disks"
; Even though the text is set to Disks, Rainmeter will display
; it as DISKS, because styleTitle contains StringCase=UPPER.

[meterLabelDisk1]
Meter=STRING
MeterStyle=styleLeftText
X=10
Y=40
W=190
H=14
Text="#disk1#\"

[meterValueDisk1]
Meter=STRING
MeterStyle=styleRightText
MeasureName=measureUsedDisk1
MeasureName2=measureTotalDisk1
X=200
Y=0r
; r stands for relative. In this case, the Y postition of meterValueCPU is 0 pixels
; below the Y value of the previous meter (i.e it's the same as in meterLabelCPU).
W=190
H=14
Text="%1B/%2B used"
; %1 stands for the value of MeasureName (measureUsedDisk1 in this case).
; %2 stands for the value of MeasureName2.
NumOfDecimals=1
AutoScale=1
; Because disk measures return the free/used space in bytes, we must use AutoScale=1 to
; automatically scale the value into a more readable figure.
LeftMouseUpAction=!Execute ["#disk1#\"]
; Open #disk1# on click

[meterBarDisk1]
Meter=BAR
MeterStyle=styleBar
MeasureName=measureUsedDisk1
X=10
Y=52
W=190
H=1
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: About FreeDiskSpace tool

Post by Kaelri »

I don't see the IfAbove and IfEqual lines anywhere in your skin. But at any rate, try reducing the UpdateDivider on [measureTotalDisk1] and [measureUsedDisk1] to 10-15.
lunary
Posts: 6
Joined: August 7th, 2011, 3:10 pm

Re: About FreeDiskSpace tool

Post by lunary »

Like this? But it doesn't work. :confused:

Code: Select all

[Rainmeter]
Update=1000

;Metadata added by RainBrowser
;http://rainmeter.net/cms/Rainmeter101-EditingSkins

[Metadata]
Name=
Config=
Description=
Instructions=
Version=
Tags=
License=
Variant=
Preview=

;End of added Metadata

[Variables]
fontName=Trebuchet MS
textSize=8
colorBar=235,170,0,255
colorText=255,255,255,205
disk1=H:

[measureTotalDisk1]
; This measure returns the total disk space
Measure=FreeDiskSpace
Drive=#disk1#
IfAboveValue=0
IfAboveAction=!SetOption "StringMeter" "Text" "%1"
IfEqualValue=0
IfEqualAction=!SetOption "StringMeter" "Text" "Removed"
Total=1
UpdateDivider=11

[measureUsedDisk1]
; Returns inverted value of free disk space (i.e. used disk space)
Measure=FreeDiskSpace
Drive=#disk1#
IfAboveValue=0
IfAboveAction=!SetOption "StringMeter" "Text" "%1"
IfEqualValue=0
IfEqualAction=!SetOption "StringMeter" "Text" "Removed"
InvertMeasure=1
UpdateDivider=11

; ----------------------------------
; STYLES are used to "centralize" options
; ----------------------------------

[styleTitle]
StringAlign=CENTER
StringCase=UPPER
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#fontName#
FontSize=10
AntiAlias=1
ClipString=1

[styleLeftText]
StringAlign=LEFT
; Meters using styleLeftText will be left-aligned.
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleRightText]
StringAlign=RIGHT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleBar]
BarColor=#colorBar#
BarOrientation=HORIZONTAL
SolidColor=255,255,255,15

; ----------------------------------
; METERS display images, text, bars, etc.
; ----------------------------------

[meterBackground]
Meter=IMAGE
ImageName=#SKINSPATH#\illustro\SHARED\Background1Line.png
; #SKINSPATH# is a global variable that stands for your skin path. It is
; usually Documents\Rainmeter\Skins.
X=0
Y=0

[meterTitle]
Meter=STRING
MeterStyle=styleTitle
; Using MeterStyle=styleTitle will basically "copy" the
; contents of the [styleTitle] section here during runtime.
X=100
Y=12
W=190
H=18
Text="Disks"
; Even though the text is set to Disks, Rainmeter will display
; it as DISKS, because styleTitle contains StringCase=UPPER.

[meterLabelDisk1]
Meter=STRING
MeterStyle=styleLeftText
X=10
Y=40
W=190
H=14
Text="#disk1#\"

[meterValueDisk1]
Meter=STRING
MeterStyle=styleRightText
MeasureName=measureUsedDisk1
MeasureName2=measureTotalDisk1
X=200
Y=0r
; r stands for relative. In this case, the Y postition of meterValueCPU is 0 pixels
; below the Y value of the previous meter (i.e it's the same as in meterLabelCPU).
W=190
H=14
Text="%1B/%2B used"
; %1 stands for the value of MeasureName (measureUsedDisk1 in this case).
; %2 stands for the value of MeasureName2.
NumOfDecimals=1
AutoScale=1
; Because disk measures return the free/used space in bytes, we must use AutoScale=1 to
; automatically scale the value into a more readable figure.
LeftMouseUpAction=!Execute ["#disk1#\"]
; Open #disk1# on click

[meterBarDisk1]
Meter=BAR
MeterStyle=styleBar
MeasureName=measureUsedDisk1
X=10
Y=52
W=190
H=1
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: About FreeDiskSpace tool

Post by Kaelri »

That's because there is no meter called "StringMeter". That was an example meter name that I used when I posted my example code. If you want to use it in an actual skin, you need to provide the actual meters.