The skin will also show the optical drives (CD, DVD). How it works?

The [DriveLabelX] (where X is between 1 and 10) will determine the label of the drives. If that's not empty, it'll set the appropriate LabelX variable to 1, otherwise to 0. This variable will be used on the [MeasureDriveX] measures.

[DriveTypeX] returns the type of the drive. Finally the [MeasureDriveX] will return a number, according to the drive type and the label. I had to take into account the label, because the FreeDiskSpace measures return 0 as the total space of a CD (or DVD). So in case of such drives, I had to check another way if the disk is present. I supposed that a not empty CD, has a label. If the disk is not empty, but its label is, the skin will fail. But I think that's not a too common situation. According to the value returned by the [MeasureDriveX], the appropriate meter group will be shown or hidden.

What you think?

Code: Select all

```
[Rainmeter]
Update=1000
DynamicWindowSize=1
[Variables]
fontcolor=255, 255, 255, 255
FontFace=Tahoma
FontFace2=Calibri
FontHeight=10
AntiAlias=1
Drive1=C:
Drive2=D:
Drive3=E:
Drive4=F:
Drive5=G:
Drive6=H:
Drive7=I:
Drive8=J:
Drive9=K:
Drive10=L:
;############## CODE ##############################################
[DriveFree1]
Measure=FreeDiskSpace
Drive=#Drive1#
IgnoreRemovable=0
[DriveLabel1]
Drive=#Drive1#
Measure=FreeDiskSpace
Label=1
IgnoreRemovable=0
IfMatch=^$
IfMatchAction=[!SetVariable Label1 "0"]
IfNotMatchAction=[!SetVariable Label1 "1"]
[DriveTotal1]
Measure=FreeDiskSpace
Drive=#Drive1#
Total=1
IgnoreRemovable=0
[DriveType1]
Measure=FreeDiskSpace
Drive=#Drive1#
IgnoreRemovable=0
Type=1
[MeasureDrive1]
Measure=Calc
Formula=((( DriveType1 = 3 ) || ( DriveType1 = 4 )) ? ( DriveTotal1 > 0 ) : (( DriveType1 = 6 ) ? #Label1# : 0 ))
IfCondition=(MeasureDrive1=1)
IfTrueAction=[!ShowMeterGroup "Drive1"]
IfFalseAction=[!HideMeterGroup "Drive1"]
DynamicVariables=1
[DriveFree2]
Measure=FreeDiskSpace
Drive=#Drive2#
IgnoreRemovable=0
[DriveLabel2]
Drive=#Drive2#
Measure=FreeDiskSpace
Label=1
IgnoreRemovable=0
IfMatch=^$
IfMatchAction=[!SetVariable Label2 "0"]
IfNotMatchAction=[!SetVariable Label2 "1"]
[DriveTotal2]
Measure=FreeDiskSpace
Drive=#Drive2#
Total=1
IgnoreRemovable=0
[DriveType2]
Measure=FreeDiskSpace
Drive=#Drive2#
IgnoreRemovable=0
Type=1
[MeasureDrive2]
Measure=Calc
Formula=((( DriveType2 = 3 ) || ( DriveType2 = 4 )) ? ( DriveTotal2 > 0 ) : (( DriveType2 = 6 ) ? #Label2# : 0 ))
IfCondition=(MeasureDrive2=1)
IfTrueAction=[!ShowMeterGroup "Drive2"]
IfFalseAction=[!HideMeterGroup "Drive2"]
DynamicVariables=1
[DriveFree3]
Measure=FreeDiskSpace
Drive=#Drive3#
IgnoreRemovable=0
[DriveLabel3]
Drive=#Drive3#
Measure=FreeDiskSpace
Label=1
IgnoreRemovable=0
IfMatch=^$
IfMatchAction=[!SetVariable Label3 "0"]
IfNotMatchAction=[!SetVariable Label3 "1"]
[DriveTotal3]
Measure=FreeDiskSpace
Drive=#Drive3#
Total=1
IgnoreRemovable=0
[DriveType3]
Measure=FreeDiskSpace
Drive=#Drive3#
IgnoreRemovable=0
Type=1
[MeasureDrive3]
Measure=Calc
Formula=((( DriveType3 = 3 ) || ( DriveType3 = 4 )) ? ( DriveTotal3 > 0 ) : (( DriveType3 = 6 ) ? #Label3# : 0 ))
IfCondition=(MeasureDrive3=1)
IfTrueAction=[!ShowMeterGroup "Drive3"]
IfFalseAction=[!HideMeterGroup "Drive3"]
DynamicVariables=1
[DriveFree4]
Measure=FreeDiskSpace
Drive=#Drive4#
IgnoreRemovable=0
[DriveLabel4]
Drive=#Drive4#
Measure=FreeDiskSpace
Label=1
IgnoreRemovable=0
IfMatch=^$
IfMatchAction=[!SetVariable Label4 "0"]
IfNotMatchAction=[!SetVariable Label4 "1"]
[DriveTotal4]
Measure=FreeDiskSpace
Drive=#Drive4#
Total=1
IgnoreRemovable=0
[DriveType4]
Measure=FreeDiskSpace
Drive=#Drive4#
IgnoreRemovable=0
Type=1
[MeasureDrive4]
Measure=Calc
Formula=((( DriveType4 = 3 ) || ( DriveType4 = 4 )) ? ( DriveTotal4 > 0 ) : (( DriveType4 = 6 ) ? #Label4# : 0 ))
IfCondition=(MeasureDrive4=1)
IfTrueAction=[!ShowMeterGroup "Drive4"]
IfFalseAction=[!HideMeterGroup "Drive4"]
DynamicVariables=1
[DriveFree5]
Measure=FreeDiskSpace
Drive=#Drive5#
IgnoreRemovable=0
[DriveLabel5]
Drive=#Drive5#
Measure=FreeDiskSpace
Label=1
IgnoreRemovable=0
IfMatch=^$
IfMatchAction=[!SetVariable Label5 "0"]
IfNotMatchAction=[!SetVariable Label5 "1"]
[DriveTotal5]
Measure=FreeDiskSpace
Drive=#Drive5#
Total=1
IgnoreRemovable=0
[DriveType5]
Measure=FreeDiskSpace
Drive=#Drive5#
IgnoreRemovable=0
Type=1
[MeasureDrive5]
Measure=Calc
Formula=((( DriveType5 = 3 ) || ( DriveType5 = 4 )) ? ( DriveTotal5 > 0 ) : (( DriveType5 = 6 ) ? #Label5# : 0 ))
IfCondition=(MeasureDrive5=1)
IfTrueAction=[!ShowMeterGroup "Drive5"]
IfFalseAction=[!HideMeterGroup "Drive5"]
DynamicVariables=1
[DriveFree6]
Measure=FreeDiskSpace
Drive=#Drive6#
IgnoreRemovable=0
[DriveLabel6]
Drive=#Drive6#
Measure=FreeDiskSpace
Label=1
IgnoreRemovable=0
IfMatch=^$
IfMatchAction=[!SetVariable Label6 "0"]
IfNotMatchAction=[!SetVariable Label6 "1"]
[DriveTotal6]
Measure=FreeDiskSpace
Drive=#Drive6#
Total=1
IgnoreRemovable=0
[DriveType6]
Measure=FreeDiskSpace
Drive=#Drive6#
IgnoreRemovable=0
Type=1
[MeasureDrive6]
Measure=Calc
Formula=((( DriveType6 = 3 ) || ( DriveType6 = 4 )) ? ( DriveTotal6 > 0 ) : (( DriveType6 = 6 ) ? #Label6# : 0 ))
IfCondition=(MeasureDrive6=1)
IfTrueAction=[!ShowMeterGroup "Drive6"]
IfFalseAction=[!HideMeterGroup "Drive6"]
DynamicVariables=1
[DriveFree7]
Measure=FreeDiskSpace
Drive=#Drive7#
IgnoreRemovable=0
[DriveLabel7]
Drive=#Drive7#
Measure=FreeDiskSpace
Label=1
IgnoreRemovable=0
IfMatch=^$
IfMatchAction=[!SetVariable Label7 "0"]
IfNotMatchAction=[!SetVariable Label7 "1"]
[DriveTotal7]
Measure=FreeDiskSpace
Drive=#Drive7#
Total=1
IgnoreRemovable=0
[DriveType7]
Measure=FreeDiskSpace
Drive=#Drive7#
IgnoreRemovable=0
Type=1
[MeasureDrive7]
Measure=Calc
Formula=((( DriveType7 = 3 ) || ( DriveType7 = 4 )) ? ( DriveTotal7 > 0 ) : (( DriveType7 = 6 ) ? #Label7# : 0 ))
IfCondition=(MeasureDrive7=1)
IfTrueAction=[!ShowMeterGroup "Drive7"]
IfFalseAction=[!HideMeterGroup "Drive7"]
DynamicVariables=1
[DriveFree8]
Measure=FreeDiskSpace
Drive=#Drive8#
IgnoreRemovable=0
[DriveLabel8]
Drive=#Drive8#
Measure=FreeDiskSpace
Label=1
IgnoreRemovable=0
IfMatch=^$
IfMatchAction=[!SetVariable Label8 "0"]
IfNotMatchAction=[!SetVariable Label8 "1"]
[DriveTotal8]
Measure=FreeDiskSpace
Drive=#Drive8#
Total=1
IgnoreRemovable=0
[DriveType8]
Measure=FreeDiskSpace
Drive=#Drive8#
IgnoreRemovable=0
Type=1
[MeasureDrive8]
Measure=Calc
Formula=((( DriveType8 = 3 ) || ( DriveType8 = 4 )) ? ( DriveTotal8 > 0 ) : (( DriveType8 = 6 ) ? #Label8# : 0 ))
IfCondition=(MeasureDrive8=1)
IfTrueAction=[!ShowMeterGroup "Drive8"]
IfFalseAction=[!HideMeterGroup "Drive8"]
DynamicVariables=1
[DriveFree9]
Measure=FreeDiskSpace
Drive=#Drive9#
IgnoreRemovable=0
[DriveLabel9]
Drive=#Drive9#
Measure=FreeDiskSpace
Label=1
IgnoreRemovable=0
IfMatch=^$
IfMatchAction=[!SetVariable Label9 "0"]
IfNotMatchAction=[!SetVariable Label9 "1"]
[DriveTotal9]
Measure=FreeDiskSpace
Drive=#Drive9#
Total=1
IgnoreRemovable=0
[DriveType9]
Measure=FreeDiskSpace
Drive=#Drive9#
IgnoreRemovable=0
Type=1
[MeasureDrive9]
Measure=Calc
Formula=((( DriveType9 = 3 ) || ( DriveType9 = 4 )) ? ( DriveTotal9 > 0 ) : (( DriveType9 = 6 ) ? #Label9# : 0 ))
IfCondition=(MeasureDrive9=1)
IfTrueAction=[!ShowMeterGroup "Drive9"]
IfFalseAction=[!HideMeterGroup "Drive9"]
DynamicVariables=1
[DriveFree10]
Measure=FreeDiskSpace
Drive=#Drive10#
IgnoreRemovable=0
[DriveLabel10]
Drive=#Drive10#
Measure=FreeDiskSpace
Label=1
IgnoreRemovable=0
IfMatch=^$
IfMatchAction=[!SetVariable Label10 "0"]
IfNotMatchAction=[!SetVariable Label10 "1"]
[DriveTotal10]
Measure=FreeDiskSpace
Drive=#Drive10#
Total=1
IgnoreRemovable=0
[DriveType10]
Measure=FreeDiskSpace
Drive=#Drive10#
IgnoreRemovable=0
Type=1
[MeasureDrive10]
Measure=Calc
Formula=((( DriveType10 = 3 ) || ( DriveType10 = 4 )) ? ( DriveTotal10 > 0 ) : (( DriveType10 = 6 ) ? #Label10# : 0 ))
IfCondition=(MeasureDrive10=1)
IfTrueAction=[!ShowMeterGroup "Drive10"]
IfFalseAction=[!HideMeterGroup "Drive10"]
DynamicVariables=1
[HDDimage1]
Meter=IMAGE
X=0
Y=0
ImageName=#@#hdd.png
LeftMouseUpAction=["#Drive1#\"]
Group=Drive1
[HDDimage2]
Meter=IMAGE
X=0r
Y=0R
ImageName=#@#hdd.png
LeftMouseUpAction=["#Drive2#\"]
Group=Drive2
[HDDimage3]
Meter=IMAGE
X=0r
Y=0R
ImageName=#@#hdd.png
LeftMouseUpAction=["#Drive3#\"]
Group=Drive3
[HDDimage4]
Meter=IMAGE
X=0r
Y=0R
ImageName=#@#hdd.png
LeftMouseUpAction=["#Drive4#\"]
Group=Drive4
[HDDimage5]
Meter=IMAGE
X=0r
Y=0R
ImageName=#@#hdd.png
LeftMouseUpAction=["#Drive5#\"]
Group=Drive5
[HDDimage6]
Meter=IMAGE
X=0r
Y=0R
ImageName=#@#hdd.png
LeftMouseUpAction=["#Drive6#\"]
Group=Drive6
[HDDimage7]
Meter=IMAGE
X=0r
Y=0R
ImageName=#@#hdd.png
LeftMouseUpAction=["#Drive7#\"]
Group=Drive7
[HDDimage8]
Meter=IMAGE
X=0r
Y=0R
ImageName=#@#hdd.png
LeftMouseUpAction=["#Drive8#\"]
Group=Drive8
[HDDimage9]
Meter=IMAGE
X=0r
Y=0R
ImageName=#@#hdd.png
LeftMouseUpAction=["#Drive9#\"]
Group=Drive9
[HDDimage10]
Meter=IMAGE
X=0r
Y=0R
ImageName=#@#hdd.png
LeftMouseUpAction=["#Drive10#\"]
Group=Drive10
[Label1]
MeasureName=DriveLabel1
Meter=string
X=56
Y=([HDDimage1:Y]+10)
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace#
Text=%1 (#Drive1#)
StringStyle=BOLD
AntiAlias=1
AutoScale=1
DynamicVariables=1
Group=Drive1
[LeftText1]
MeasureName=DriveFree1
Meter=STRING
X=0r
Y=15r
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace2#
Text=Free: %1B
Percentual=0
AntiAlias=1
AutoScale=1
Group=Drive1
[Label2]
MeasureName=DriveLabel2
Meter=string
X=56
Y=([HDDimage2:Y]+10)
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace#
Text=%1 (#Drive2#)
StringStyle=BOLD
AntiAlias=1
AutoScale=1
DynamicVariables=1
Group=Drive2
[LeftText2]
MeasureName=DriveFree2
Meter=STRING
X=0r
Y=15r
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace2#
Text=Free: %1B
Percentual=0
AntiAlias=1
AutoScale=1
Group=Drive2
[Label3]
MeasureName=DriveLabel3
Meter=string
X=56
Y=([HDDimage3:Y]+10)
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace#
Text=%1 (#Drive3#)
StringStyle=BOLD
AntiAlias=1
AutoScale=1
DynamicVariables=1
Group=Drive3
[LeftText3]
MeasureName=DriveFree3
Meter=STRING
X=0r
Y=15r
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace2#
Text=Free: %1B
Percentual=0
AntiAlias=1
AutoScale=1
Group=Drive3
[Label4]
MeasureName=DriveLabel4
Meter=string
X=56
Y=([HDDimage4:Y]+10)
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace#
Text=%1 (#Drive4#)
StringStyle=BOLD
AntiAlias=1
AutoScale=1
DynamicVariables=1
Group=Drive4
[LeftText4]
MeasureName=DriveFree4
Meter=STRING
X=0r
Y=15r
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace2#
Text=Free: %1B
Percentual=0
AntiAlias=1
AutoScale=1
Group=Drive4
[Label5]
MeasureName=DriveLabel5
Meter=string
X=56
Y=([HDDimage5:Y]+10)
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace#
Text=%1 (#Drive5#)
StringStyle=BOLD
AntiAlias=1
AutoScale=1
DynamicVariables=1
Group=Drive5
[LeftText5]
MeasureName=DriveFree5
Meter=STRING
X=0r
Y=15r
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace2#
Text=Free: %1B
Percentual=0
AntiAlias=1
AutoScale=1
Group=Drive5
[Label6]
MeasureName=DriveLabel6
Meter=string
X=56
Y=([HDDimage6:Y]+10)
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace#
Text=%1 (#Drive6#)
StringStyle=BOLD
AntiAlias=1
AutoScale=1
DynamicVariables=1
Group=Drive6
[LeftText6]
MeasureName=DriveFree6
Meter=STRING
X=0r
Y=15r
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace2#
Text=Free: %1B
Percentual=0
AntiAlias=1
AutoScale=1
Group=Drive6
[Label7]
MeasureName=DriveLabel7
Meter=string
X=56
Y=([HDDimage7:Y]+10)
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace#
Text=%1 (#Drive7#)
StringStyle=BOLD
AntiAlias=1
AutoScale=1
DynamicVariables=1
Group=Drive7
[LeftText7]
MeasureName=DriveFree7
Meter=STRING
X=0r
Y=15r
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace2#
Text=Free: %1B
Percentual=0
AntiAlias=1
AutoScale=1
Group=Drive7
[Label8]
MeasureName=DriveLabel8
Meter=string
X=56
Y=([HDDimage8:Y]+10)
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace#
Text=%1 (#Drive8#)
StringStyle=BOLD
AntiAlias=1
AutoScale=1
DynamicVariables=1
Group=Drive8
[LeftText8]
MeasureName=DriveFree8
Meter=STRING
X=0r
Y=15r
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace2#
Text=Free: %1B
Percentual=0
AntiAlias=1
AutoScale=1
Group=Drive8
[Label9]
MeasureName=DriveLabel9
Meter=string
X=56
Y=([HDDimage9:Y]+10)
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace#
Text=%1 (#Drive9#)
StringStyle=BOLD
AntiAlias=1
AutoScale=1
DynamicVariables=1
Group=Drive9
[LeftText9]
MeasureName=DriveFree9
Meter=STRING
X=0r
Y=15r
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace2#
Text=Free: %1B
Percentual=0
AntiAlias=1
AutoScale=1
Group=Drive9
[Label10]
MeasureName=DriveLabel10
Meter=string
X=56
Y=([HDDimage10:Y]+10)
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace#
Text=%1 (#Drive10#)
StringStyle=BOLD
AntiAlias=1
AutoScale=1
DynamicVariables=1
Group=Drive10
[LeftText10]
MeasureName=DriveFree10
Meter=STRING
X=0r
Y=15r
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace2#
Text=Free: %1B
Percentual=0
AntiAlias=1
AutoScale=1
Group=Drive10
```