It is currently April 18th, 2024, 11:36 pm

find the maximum capacity of your recycle bin

Tips and Tricks from the Rainmeter Community
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

find the maximum capacity of your recycle bin

Post by moshi »

how about using a roundline or bar meter for the recycle bin?

first of all: this is a worthless bit of information. Windows just does not work that way. there is no such thing as "the recycle bin is 50% full", at least not if you are using more than one volume drive. each drive has it's own hidden folder with it's own maximum capacity. so your recyle bin for drive C: might be completely empty while the recyle bin for drive D: might be almost full.
anyways, there are many Rainmeter skins that aren't really useful, so let's add another one.



basically it's really simple. you just add a MaxValue to your measure.
http://docs.rainmeter.net/manual/measures/general-options#MaxValue

Code: Select all

[MeasureBinSize]
Measure=Plugin
Plugin=RecycleManager
RecycleType=Size
MaxValue=10485760


but how do we get that MaxValue?
well, you just need to read the maximum capacities for the single drives from the registry (those are in MB) and add them up:
http://docs.rainmeter.net/manual/measures/registry

Code: Select all

[Capacity1]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume\{4efed059-dc8c-11e1-a322-806e6f6e6963}
RegValue=MaxCapacity

[Capacity2]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume\{b9af5e5e-dcbe-11e1-96fc-001f16cfcec9}
RegValue=MaxCapacity

...

[MaxCapacity]
Measure=Calc
Formula=([Capacity1]+[Capacity2]+...)*1024*1024
DynamicVariables=1


but that involves the GUIDs for the individual drives. how do we get those? let's get a list of these from the registry. that's not possible with Rainmeter though. you'll need to use the reg query command that comes with Windows. use this from the command line:
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume"
and you'll get a list of registry keys similar to this:

Code: Select all

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume\{4efed059-dc8c-11e1-a322-806e6f6e6963}
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume\{4efed05a-dc8c-11e1-a322-806e6f6e6963}
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume\{b9af5e5e-dcbe-11e1-96fc-001f16cfcec9}
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume\{b9af5e65-dcbe-11e1-96fc-001f16cfcec9}


looks like a task for the RunCommand plugin:
http://rainmeter.net/forum/viewtopic.php?f=18&t=16715

Code: Select all

[Command_1]
Measure=Plugin
Plugin=RunCommand
Parameter="reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume""
FinishAction=[!UpdateMeasureGroup Drives]
OutputType=Ansi


and now let's use some regular expression substitutes to get the individual GUIDs:

Code: Select all

[Drive1]
Measure=Calc
Formula=1
DynamicVariables=1
Group=Drives
UpdateDivider=-1
RegExpSubstitute=1
Substitute="1":"[Command_1]","\n":"","^.*?\{(.*?)\}.*$":"\1","^HKEY.*$":""
OnUpdateAction=[!UpdateMeasure Capacity1]

[Drive2]
Measure=Calc
Formula=1
DynamicVariables=1
Group=Drives
UpdateDivider=-1
RegExpSubstitute=1
Substitute="1":"[Command_1]","\n":"","^.*?\{(.*?)\}.*?\{(.*?)\}.*$":"\2","^HKEY.*$":""
OnUpdateAction=[!UpdateMeasure Capacity2]

...
Last edited by moshi on January 6th, 2014, 10:42 am, edited 1 time in total.
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: find the maximum capacity of your recycle bin

Post by moshi »

don't understand?
can't be bothered to read?

here's an example skin for a maximum of five drives. when i say five drives, i mean drives that do have a recycle bin, a DVD drive for example doesn't count here. design by jsmorley (shamelessly stolen by me):

Code: Select all

[Rainmeter]
OnRefreshAction=[!CommandMeasure Command_1 Run]

[Command_1]
Measure=Plugin
Plugin=RunCommand
Parameter="reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume""
FinishAction=[!UpdateMeasureGroup Drives]
OutputType=Ansi

[Drive1]
Measure=Calc
Formula=1
DynamicVariables=1
Group=Drives
UpdateDivider=-1
RegExpSubstitute=1
Substitute="1":"[Command_1]","\n":"","^.*?\{(.*?)\}.*$":"\1","^HKEY.*$":""
OnUpdateAction=[!UpdateMeasure Capacity1]

[Drive2]
Measure=Calc
Formula=1
DynamicVariables=1
Group=Drives
UpdateDivider=-1
RegExpSubstitute=1
Substitute="1":"[Command_1]","\n":"","^.*?\{(.*?)\}.*?\{(.*?)\}.*$":"\2","^HKEY.*$":""
OnUpdateAction=[!UpdateMeasure Capacity2]

[Drive3]
Measure=Calc
Formula=1
DynamicVariables=1
Group=Drives
UpdateDivider=-1
RegExpSubstitute=1
Substitute="1":"[Command_1]","\n":"","^.*?\{(.*?)\}.*?\{(.*?)\}.*?\{(.*?)\}.*$":"\3","^HKEY.*$":""
OnUpdateAction=[!UpdateMeasure Capacity3]

[Drive4]
Measure=Calc
Formula=1
DynamicVariables=1
Group=Drives
UpdateDivider=-1
RegExpSubstitute=1
Substitute="1":"[Command_1]","\n":"","^.*?\{(.*?)\}.*?\{(.*?)\}.*?\{(.*?)\}.*?\{(.*?)\}.*$":"\4","^HKEY.*$":""
OnUpdateAction=[!UpdateMeasure Capacity4]

[Drive5]
Measure=Calc
Formula=1
DynamicVariables=1
Group=Drives
UpdateDivider=-1
RegExpSubstitute=1
Substitute="1":"[Command_1]","\n":"","^.*?\{(.*?)\}.*?\{(.*?)\}.*?\{(.*?)\}.*?\{(.*?)\}.*?\{(.*?)\}.*$":"\5","^HKEY.*$":""
OnUpdateAction=[!UpdateMeasure Capacity5]

; ... add more ...

[Capacity1]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume\{[Drive1]}
RegValue=MaxCapacity
DynamicVariables=1
UpdateDivider=-1

[Capacity2]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume\{[Drive2]}
RegValue=MaxCapacity
DynamicVariables=1
UpdateDivider=-1

[Capacity3]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume\{[Drive3]}
RegValue=MaxCapacity
DynamicVariables=1
UpdateDivider=-1

[Capacity4]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume\{[Drive4]}
RegValue=MaxCapacity
DynamicVariables=1
UpdateDivider=-1

[Capacity5]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume\{[Drive5]}
RegValue=MaxCapacity
DynamicVariables=1
UpdateDivider=-1

; ... add more ...

OnUpdateAction=[!UpdateMeasure MaxCapacity]


[MaxCapacity]
Measure=Calc
Formula=([Capacity1]+[Capacity2]+[Capacity3]+[Capacity4]+[Capacity5])*1024*1024
DynamicVariables=1
UpdateDivider=-1

[MeasureBinSize]
Measure=Plugin
Plugin=RecycleManager
RecycleType=Size
MaxValue=[MaxCapacity]
DynamicVariables=1

[MeasureFree]
Measure=Calc
Formula=([MaxCapacity]-[MeasureBinSize])
DynamicVariables=1
MaxValue=[MaxCapacity]


[MeterRoundBack]
Meter=Roundline
X=0
Y=0
W=120
H=120
StartAngle=4.712
RotationAngle=6.283
LineLength=60
LineColor=25,71,89,255
Solid=1
AntiAlias=1
UpdateDivider=-1

[MeterUsedRecycle]
Meter=Roundline
MeasureName=MeasureBinSize
X=0
Y=0
W=120
H=120
StartAngle=4.712
RotationAngle=6.283
LineLength=57
LineColor=62,140,132,255
Solid=1
AntiAlias=1

[MeterFreeRecycle]
Meter=Roundline
MeasureName=MeasureFree
X=0
Y=0
W=120
H=120
StartAngle=4.712
RotationAngle=-6.283
LineLength=53
LineColor=216,242,240,255
Solid=1
AntiAlias=1

[MeterTotal]
Meter=String
MeasureName=MaxCapacity
W=130
H=15
X=65
Y=124
FontSize=10
FontColor=255,255,255,255
SolidColor=25,71,89,255
StringStyle=Bold
StringAlign=Center
AntiAlias=1
AutoScale=1
Text=Total: %1B

[MeterUsed]
Meter=String
MeasureName=MeasureBinSize
W=130
H=15
X=65
Y=2R
FontSize=10
FontColor=255,255,255,255
SolidColor=62,140,132,255
StringStyle=Bold
StringAlign=Center
AntiAlias=1
AutoScale=1
Text=Used: %1B

[MeterFree]
Meter=String
MeasureName=MeasureFree
W=130
H=15
X=65
Y=2R
FontSize=10
FontColor=25,71,89,255
SolidColor=216,242,240,255
StringStyle=Bold
StringAlign=Center
AntiAlias=1
AutoScale=1
Text=Free: %1B
screenshot-Rainmeter-06.01.2014 , 11_30_02-001.png
You do not have the required permissions to view the files attached to this post.
User avatar
Dank420
Posts: 145
Joined: April 3rd, 2013, 1:04 am
Location: O-High-O

Re: find the maximum capacity of your recycle bin

Post by Dank420 »

With saintly patience, and a firm resolve............ :) :x
:thumbup:
User avatar
Active Colors
Moderator
Posts: 1251
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: find the maximum capacity of your recycle bin

Post by Active Colors »

Capture.PNG
Something goes wrong...
You do not have the required permissions to view the files attached to this post.
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: find the maximum capacity of your recycle bin

Post by moshi »

first post wrote:looks like a task for the RunCommand plugin:
viewtopic.php?f=18&t=16715
User avatar
Active Colors
Moderator
Posts: 1251
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: find the maximum capacity of your recycle bin

Post by Active Colors »

moshi wrote:
I've put plugin into the plugins directory and still it doesn't work.

Log shows me that RunCommand plugin is not found but in the Plugins tab this plugin is listed.
Capture1.PNG
Capture2.PNG
(r2282 and r2280)
You do not have the required permissions to view the files attached to this post.
Last edited by Active Colors on February 24th, 2014, 1:36 pm, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: find the maximum capacity of your recycle bin

Post by jsmorley »

That sounds like you are using a 32bit plugin with 64bit Rainmeter or visa versa...
User avatar
Active Colors
Moderator
Posts: 1251
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: find the maximum capacity of your recycle bin

Post by Active Colors »

jsmorley wrote:That sounds like you are using a 32bit plugin with 64bit Rainmeter or visa versa...
My system is 32-bit. Redownloaded now plugin. Still doesn't work. I tried also 64-bit plugin to be sure, nothing happens.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: find the maximum capacity of your recycle bin

Post by jsmorley »

If you download this skin: http://rainmeter.net/forum/download/file.php?id=7532 and install it, does the example skin work?
User avatar
Active Colors
Moderator
Posts: 1251
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: find the maximum capacity of your recycle bin

Post by Active Colors »

jsmorley wrote:If you download this skin: http://rainmeter.net/forum/download/file.php?id=7532 and install it, does the example skin work?
Capture.PNG
I also tried to turn off and close an antivirus to check if it disables plugin to work properly. Still...
You do not have the required permissions to view the files attached to this post.