I have downloaded the sample and have it working. I see in the documentation that it returns the 'Drive Letter'; when I run the sample script, it shows the disk label not the letter. I have 5 NAS drives that it does not find as well as not finding the removable disks. The count comes back as 9 which is the number of internal hard disks on the machine. I have the options for network and removable disks turned on in the script.
Thanks for the plugin, it will be a good addition to my scripts.
It is currently September 28th, 2024, 11:03 pm
DriveList 2.0
-
- Posts: 39
- Joined: January 15th, 2015, 9:05 am
Re: DriveList 2.0
Don't lose heart, someone may want it and not waste time with a messy search
-
- Posts: 232
- Joined: July 1st, 2011, 1:32 am
- Location: US
Re: DriveList 2.0
Apologies that this reply is late enough to be pretty well useless; I haven't been keeping up on the forums recently.fred_gaou wrote:Hi, I don't know if it's a bug or if it's by designed but the count of drives returned by the parent measure is always 0 the first time the measure operate. It returns the actual number of drives only after the parent measure run again either after the updatedivider specified in the measure or by a manual bang such asIt doesn't seem logical to me. Could you explain this, please?Code: Select all
LeftMouseUpAction=[!UpdateMeasure "parentMeasure"]
It was not by design, and I think I will call it a bug. I haven't worked on this project in a long time, but after looking over my code again I think I have an explanation of sorts. It is a little technical, having to do with how the plugin API works. A plugin measure's String value and Number value are returned from different methods in the plugin code.
The string value comes from "GetString", which Rainmeter may call "on demand". In the case of the example skin, I think it is called when the FreeDiskSpace measures are updated, so that the Measure Variable controlling Drive setting gets the most recent value.
The numeric value is returned by from the Update() method, which is always called once per update cycle. So there is no way for a measures numeric value to be updated more than once per update cycle.
So I think it is happening something like this:
- On the very first update cycle, the measure starts counting the drives but immediately returns zero before the counting is finished; this happens because the counting is happening in a background thread, which is required so that the plugin does not hang Rainmeter if the counting takes a long time.
- In between cycles, counting finishes and the FinishAction fires. The FreeDiskSpace measures are all updated, and they get the correct string values for the DriveList measures through GetString, using Dynamic Measure Variables.
- On the next update tick, the measure returns the count from the current list of drives and starts updating the list.
Flying Hyrax on DeviantArt
-
- Posts: 232
- Joined: July 1st, 2011, 1:32 am
- Location: US
Re: DriveList 2.0
Sorry about the very tardy reply; I haven't been keeping up with the forums at all lately.jeffhobson wrote:I have downloaded the sample and have it working. I see in the documentation that it returns the 'Drive Letter'; when I run the sample script, it shows the disk label not the letter.
That's the specific sample skin. The plugin measures are returning drive letters as their string values; these in turn are used in FreeDiskSpace measures to, in the case of the sample, show the disk label and free space. You can use additional measures to get more disk information or display the drive letters themselves using DynamicVariables in a string meter.
Keep in mind that the sample skin is not written to dynamically display all the drives the plugin finds, only the first three... but the count should be accurate, so I'm not sure why it wouldn't be finding your removable and network drives. Those are actually turned on by default - it shouldn't even need the "Removable" and "Network" options unless you want to exclude those types. If it shows up with a drive letter under "My Computer" (or "This Computer", or whatever they're calling it in Windows 8+ these days...) the measure should find it. I haven't had any trouble with USB drives or mapped network drives myself, so this might be kind of hard to debug.jeffhobson wrote: I have 5 NAS drives that it does not find as well as not finding the removable disks. The count comes back as 9 which is the number of internal hard disks on the machine. I have the options for network and removable disks turned on in the script.
Flying Hyrax on DeviantArt
-
- Posts: 426
- Joined: February 8th, 2015, 10:07 pm
- Location: EU, Denmark.
Re: DriveList 2.0
Is it possible to make start the count at 1 in stead of 0?index - the measure will return the drive letter at this position in the list. (First position is 0.)
1 = C:/
2 = D:/
3 = E:/
4 = F:/
And how do i use the NumberType=Count?
This returns a blank value:
Code: Select all
[TotalDrives]
Measure=Plugin
Plugin=DriveList.dll
NumberType=Count
UpdateDivider=5
DynamicVariables=1
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
-
- Rainmeter Sage
- Posts: 5534
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: DriveList 2.0
No, the plugin indexes start at zero.StArL0rd84 wrote:Is it possible to make start the count at 1 in stead of 0?
1 = C:/
2 = D:/
3 = E:/
4 = F:/
Where does it return 'blank'? It does take 5 updates before this appears...StArL0rd84 wrote:And how do i use the NumberType=Count?
This returns a blank value:Code: Select all
[TotalDrives] Measure=Plugin Plugin=DriveList.dll NumberType=Count UpdateDivider=5 DynamicVariables=1
Did you create a meter to display [TotalDrives:]?
Code: Select all
[MeterDriveCount]
Meter=String
NumOfDecimals=0
X=5
Y=5
Text="Count: [TotalDrives:]"
DynamicVariables=1
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Posts: 426
- Joined: February 8th, 2015, 10:07 pm
- Location: EU, Denmark.
Re: DriveList 2.0
Nevermindeclectic-tech wrote: Works here...
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
-
- Rainmeter Sage
- Posts: 5534
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: DriveList 2.0
This is an example of why it would help troubleshooting if both the STRING and NUMBER values were shown in the log.
With your measure, the log will not show any value, it is 'blank' because the STRING value is empty, but the measure does return a NUMBER value of '2'. That's why you need to use a section variable [TotalDrives:] in the meter to see it.
The only way to see something about this measure in the log is to add INDEX=0 to the measure; then it will return the drive letter in the log 'C:'.
Hope you get this working.
With your measure, the log will not show any value, it is 'blank' because the STRING value is empty, but the measure does return a NUMBER value of '2'. That's why you need to use a section variable [TotalDrives:] in the meter to see it.
The only way to see something about this measure in the log is to add INDEX=0 to the measure; then it will return the drive letter in the log 'C:'.
Hope you get this working.
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Posts: 426
- Joined: February 8th, 2015, 10:07 pm
- Location: EU, Denmark.
Re: DriveList 2.0
I forgot a colon in my meter that's why it was blank.
ty
ty
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
-
- Posts: 426
- Joined: February 8th, 2015, 10:07 pm
- Location: EU, Denmark.
Re: DriveList 2.0
This plugin is freakin' awesome man.
Made a skin that requires absolutely no input from the user.
It supports up to 10 drives and i might add a few more.
Made 10 different ini files, and whenever a drive is disconnected or reconnected the skin adapts.
And because the @include function cannot be dynamic i had to get creative with some measures.
A week later i think i finally landed on a solution. The skin auto switches between the ini files like this:
I hope this helps someone.
Made a skin that requires absolutely no input from the user.
It supports up to 10 drives and i might add a few more.
Made 10 different ini files, and whenever a drive is disconnected or reconnected the skin adapts.
And because the @include function cannot be dynamic i had to get creative with some measures.
A week later i think i finally landed on a solution. The skin auto switches between the ini files like this:
Code: Select all
[Variables]
NumberOfDrives=7
[TotalDrives1]
Measure=Plugin
Plugin=DriveList.dll
NumberType=Count
DynamicVariables=1
[TotalDrives2]
Measure=calc
Formula=TotalDrives1
Substitute="0":"#NumberOfDrives#"
DynamicVariables=1
OnChangeAction=[!SetVariable NumberOfDrives [TotalDrives2]][!WriteKeyValue Variables NumberOfDrives "([TotalDrives2])"][!UpdateMeter *][!Redraw]
[NumberOfDrives]
Measure=calc
Formula=#NumberOfDrives#
DynamicVariables=1
OnChangeAction=[!Refresh]
@include1=#SKINSPATH#SKINNAME\HDDs\Configurations\#NumberOfDrives#.ini
You do not have the required permissions to view the files attached to this post.
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
-
- Posts: 60
- Joined: July 30th, 2014, 1:00 am
[BUG] Crashes rainmeter since one of last MS update
If it has suddenly started to crash rainmeter since june MS update, see and vote for this issue on GitHub.
I will miss it if it is not updated to fix this.
I will miss it if it is not updated to fix this.
- Rainmeter 4.3.1.3321 64-bit (Sep 22 2019) - French (1036)
- Windows 10 Pro 1909 64-bit (build 18363) - French (1036)
- Path: D:\Programmes\Customisation\Rainmeter\
- SkinPath: D:\Programmes\Customisation\Rainmeter\Skins\
- SettingsPath: D:\Programmes\Customisation\Rainmeter\
- IniFile: D:\Programmes\Customisation\Rainmeter\Rainmeter.ini