Page 2 of 2

Re: Add some new string...

Posted: March 22nd, 2017, 4:00 pm
by CyborgTJB
balala wrote:Yeah, you're right. Those actions are done by the Drives.exe utility, provided into the @Resources folder, through the IfTrueAction options of the [MeasureFireActionC] - [MeasureFireActionZ] measures.
But here you can see that Bekarfel had right: these tasks are done by a third party app (Drive.exe).
Uuummm.... I still done get it. :? :?
I'm a nerd on theory from the beginning of my classes. I'm good at practical.
So can you provide me the exact thing? (No pressure)

Re: Add some new string...

Posted: March 22nd, 2017, 4:47 pm
by balala
CyborgTJB wrote:Uuummm.... I still done get it. :? :?
I'm a nerd on theory from the beginning of my classes. I'm good at practical.
So can you provide me the exact thing? (No pressure)
I'm not sure what "exact thing" are you thinking about. The skin you've posted, using the Drives.exe, does exactly what you need. I'm not sure...
But in Brian's last post, you can see an easy way to get the file system, without using an external app. Thanks Brian, brilliant idea:

Code: Select all

[Rainmeter]
Update=1000
OnRefreshAction=[!CommandMeasure "MeasureRun" "Run"]
DynamicWindowSize=1

[Variables]
Drive=C:

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=wmic volume where DriveLetter="#Drive#" get FileSystem
State=Hide
OutputType=ANSI
RegExpSubstitute=1
Substitute="FileSystem ":"","#CRLF#":""

[MeterDrive]
Meter=String
MeasureName=MeasureRun
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=File system of drive #Drive# %1

Re: Add some new string...

Posted: March 22nd, 2017, 4:53 pm
by CyborgTJB
Thanks a lot again Balala...
This is the exact thing I'm talking about.
One thing though...
What is "OutputType=ANSI"? :confused:

and is this code will work if I add it will exact drive letter in my skin?
http://fav.me/dak9j23

Re: Add some new string...

Posted: March 22nd, 2017, 5:57 pm
by balala
CyborgTJB wrote:One thing though...
What is "OutputType=ANSI"? :confused:
Don't be too confused. RunCommand is a "built in" plugin and as such, it has a very good help. The OutputType=ANSI option specifies the type of the output of, in this case, wmic.exe app. In this case, this must be ANSI.
CyborgTJB wrote:and is this code will work if I add it will exact drive letter in my skin?
http://fav.me/dak9j23
Obviously, it will.

Re: Add some new string...

Posted: March 22nd, 2017, 6:46 pm
by balala
And finally here is a solution to get the interface of a drive, through the same wmic.exe. Note that in this case you can't get this information using the drive letter, but using the number of the physical drive (which starts with 0), because the interface isn't related to the partition, but to the physical drive:

Code: Select all

[Rainmeter]
Update=1000
OnRefreshAction=[!CommandMeasure "MeasureRun" "Run"]
DynamicWindowSize=1

[Variables]
DiskDrive=0

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=wmic DISKDRIVE get InterfaceType,Name
State=Hide
OutputType=ANSI
RegExpSubstitute=1
Substitute="InterfaceType\s+Name":"","(.*)\s+\\\\\.\\PHYSICALDRIVE#DiskDrive#":"\1","(.*)\s+\\\\\.\\PHYSICALDRIVE0":"","(.*)\s+\\\\\.\\PHYSICALDRIVE1":"","(.*)\s+\\\\\.\\PHYSICALDRIVE2":"","(.*)\s+\\\\\.\\PHYSICALDRIVE3":"","(.*)\s+\\\\\.\\PHYSICALDRIVE4":"","(.*)\s+\\\\\.\\PHYSICALDRIVE5":"","(.*)\s+\\\\\.\\PHYSICALDRIVE6":"","(.*)\s+\\\\\.\\PHYSICALDRIVE7":"","(.*)\s+\\\\\.\\PHYSICALDRIVE8":"","(.*)\s+\\\\\.\\PHYSICALDRIVE9":"","(.*)\s+\\\\\.\\PHYSICALDRIVE10":"","#CRLF#":"","\s+":"","^$":"ERROR"
FinishAction=[!ShowMeter "MeterDrive"]

[MeterDrive]
Meter=String
MeasureName=MeasureRun
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=%1
Hidden=1
The DiskDrive variable represents the number of the physical drive. As I said, it starts from 0, so for the first drive it is 0, for the second one (if there is a such one) it is 1 and so on. Just add the number representing the drive you'd like to check. With the wmic DISKDRIVE get InterfaceType,Name command (type or paste it to a command prompt), you'll get a list of the installed drives onto your system. Details: https://www.lisenet.com/2014/get-windows-system-information-via-wmi-command-line-wmic/ (scroll down to the "Get Information About Physical Drives" section).

Re: Add some new string...

Posted: March 22nd, 2017, 11:15 pm
by Bekarfel
balala wrote:As Bekarfel said above, if you divide the used disk space by the total disk space, you'll get the percentage of the used disk space (well, he talked about the free space, but the idea is the same).
I chose free space only because that's the default return value of FreeDiskSpace 8-)

Re: Add some new string...

Posted: March 22nd, 2017, 11:30 pm
by jsmorley
Bekarfel wrote:I chose free space because that's the default return value of FreeDiskSpace
Just an aside, with FreeDiskSpace and Memory and other measures that automatically set the MaxValue of the measure, or any measure like Network where you manually set MaxValue, you can also just use:

[MeasureName:%]

and maybe define decimal places to 2:

[MeasureName:%,2]

To get the value expressed as a percentage.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[MeasureTotalDisk]
Measure=FreeDiskSpace
Drive=C:
Total=1

[MeasureUsedDisk]
Measure=FreeDiskSpace
Drive=C:
InvertMeasure=1

[MeasureFreeDisk]
Measure=FreeDiskSpace
Drive=C:

[MeterDriveStuff]
Meter=String
MeasureName=MeasureTotalDisk
MeasureName2=MeasureUsedDisk
MeasureName3=MeasureFreeDisk
InlineSetting=Size | 12
InlineSetting2=Weight | 400
InlineSetting3=Color | 255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
NumOfDecimals=2
AutoScale=2
AntiAlias=1
DynamicVariables=1
Text=Total:	%1B#CRLF#Used:	%2B	([MeasureUsedDisk:%,2]%)#CRLF#Free:	%3B	([MeasureFreeDisk:%,2]%)

[MeterDriveBar]
Meter=Bar
MeasureName=MeasureUsedDisk
Y=0R
W=[MeterDriveStuff:W]
H=5
BarOrientation=Horizontal
BarColor=68,171,89,255
SolidColor=97,97,97,255
DynamicVariables=1
1.jpg
https://docs.rainmeter.net/manual/variables/section-variables/#Percentual

Re: Add some new string...

Posted: March 23rd, 2017, 3:20 pm
by CyborgTJB
I saw it. I like it.
Requesting permission to add it to my all in one skin...

Re: Add some new string...

Posted: March 23rd, 2017, 5:16 pm
by balala
jsmorley wrote:Just an aside, with FreeDiskSpace and Memory and other measures that automatically set the MaxValue of the measure, or any measure like Network where you manually set MaxValue, you can also just use:

[MeasureName:%]

and maybe define decimal places to 2:

[MeasureName:%,2]

To get the value expressed as a percentage.
That's a very interesting feature, I had no idea about it before. Thanks jsmorley, seems very useful.

That's why I said many times that there's always something new to be learned with Rainmeter.

Re: Add some new string...

Posted: April 1st, 2017, 3:33 am
by CyborgTJB
Yes you are, my buddy. I love you all... 8-)