[Rainmeter]

[Background]
Meter=IMAGE
ImageName=Background.png

Update=300
[Metadata]
Name=USBDrive
Information=Skin to display info and safely eject a USB drive.

[Variables]
Drive=F:
FontColor= 81, 168, 255
ImageTint=230,255,207
BlueLimit=0.95
; If the drive usage is above BlueLimit (in this case 95%), the displayed bar will be red, otherwise blue.

[MeasureTypeDrive]
Measure=FreeDiskSpace
Drive=#Drive#
Type=1
IgnoreRemovable=0
UpdateDivider=2

[MeasureLabelDrive]
Measure=FreeDiskSpace
Drive=#Drive#
Label=1
IgnoreRemovable=0
UpdateDivider=2

[MeasureTotalDrive]
Measure=FreeDiskSpace
Drive=#Drive#
Total=1
IgnoreRemovable=0
UpdateDivider=2

[MeasureFreeDrive]
Measure=FreeDiskSpace
Drive=#Drive#
IgnoreRemovable=0
UpdateDivider=2

[MeasureUsedDrive]
Measure=FreeDiskSpace
Drive=#Drive#
InvertMeasure=1
IgnoreRemovable=0
UpdateDivider=2

[MeasureLuaScript]
Measure=Script
ScriptFile=#CURRENTPATH#USBDrive.lua
UpdateDivider=1

[MeterDriveLabelLetter]
Meter=String
MeasureName=MeasureLabelDrive

X=7r
Y=10
W=118
H=15
StringAlign=LEFT
FontFace=Agency FB
FontColor=#FontColor#
FontSize=12
StringStyle=Bold
AntiAlias=1
Text=%1 
ClipString=1

[MeterRemoved]
Meter=String
X=18
Y=30
StringAlign=LEFT
FontFace=Agency FB
FontColor=#FontColor#
FontSize=15
StringStyle=Bold
AntiAlias=1
StringCase=PROPER
Hidden=1

[MeterButtonEject]
Meter=BUTTON
ButtonImage=Eject.png
X=8
Y=42
LeftMouseUpAction=!Execute ["#CURRENTPATH#RunHidden.exe" "#CURRENTPATH#RemoveDrive.exe" "#Drive# -b" "ERR"]
DynamicVariables=1

[MeterButtonOpen]
Meter=BUTTON
ButtonImage=Open.png
X=50
Y=42
LeftMouseUpAction=!Execute ["#Drive#"]


[DriveLetter]
Meter=STRING
StringAlign=RIGHT
X=120
Y=50
StringStyle=BOLDITALIC
StringCase=UPPER
FontColor=115,123,127,120
FontSize=18
FontFace=Tahoma
Text=#Drive#
AntiAlias=1
Hidden=0

[BinBarColor]
Measure=Calc
Formula=( MeasureUsedDrive / MeasureTotalDrive )
IfAboveAction=!Execute [!SetOption MeterDriveBar BarImage "RedBar.png"]
IfAboveValue=#BlueLimit#
IfEqualAction=!execute [!SetOption MeterDriveBar BarImage "BlueBar.png"]
IfEqualValue=#BlueLimit#
IfBelowAction=!execute [!SetOption MeterDriveBar BarImage "BlueBar.png"]
IfBelowValue=#BlueLimit#

[MeasureErrorMessage]
Measure=Calc
Formula=#ERR#
DynamicVariables=1

[DriveBarTotal]
Meter=IMAGE
X=7
Y=29
W=114
H=10
ImageTint=#ImageTint#
ToolTipTitle=Drive #Drive#  ([MeasureLabelDrive])
TooltipType=1
TooltipIcon="#CURRENTPATH#Usb.ico"
DynamicVariables=1
ImageName=

[MeterDriveBar]
Meter=Bar
MeasureName=MeasureUsedDrive
BarOrientation=Horizontal
X=0r
Y=0r
Hidden=1

[MeterPercent]
Meter=String
MeasureName=MeasureUsedDrive
X=95
Y=40
StringAlign=LEFT
FontFace=Tahoma
FontColor= 81, 168, 255
FontSize=7
StringStyle=Bold
AntiAlias=1
Percentual=1
Text=%1%
Hidden=1

[MeterShowDriveFree]
MeasureName=MeasureFreeDrive
Meter=STRING
X=76
Y=64
FontColor= 81, 168, 255
StringStyle=Bold
Fontsize=7
StringAlign=RIGHT
FontFace=Tahoma
Text="Free: %1b"
AntiAlias=1
NumOfDecimals=1
AutoScale=1