It is currently May 6th, 2024, 11:56 am

Recycle Bin

Get help with creating, editing & fixing problems with skins
brunogasparsc
Posts: 22
Joined: June 28th, 2011, 4:38 pm

Recycle Bin

Post by brunogasparsc »

Hi!
I'm making a Recycle Bin icon with the line:
LeftMouseUpAction=!execute ["::{645FF040-5081-101B-9F08-00AA002F954E}"] I found this key on the software Keybreeze.
This opens the Recycle Bin. But what is the command to "empty" the Recycle Bin?
(I know that there is a plugin, but... I'm a beginner, I've read the manual and sincerely didn't understand how to use it!)
User avatar
Jkon
Posts: 185
Joined: December 4th, 2009, 2:05 am

Re: Recycle Bin

Post by Jkon »

To the best of my knowledge you have to use the plugin.

If all you want is a simple recycle bin then all you need is one measure and one meter.

[MeasureRecyclebin]
Measure=Plugin
Plugin=Plugins\RecycleManager.dll
RecycleType=Size
Drives=C:
UpdateDivider=3

[MeterRecyclebin]
Meter=Image
Imagename=your imagename here.png
X=0
Y=0
LeftMouseUpAction =!Execute [!RainmeterPluginBang "MeasureRecyclebin OpenBin"]
RightMouseUpAction=!Execute [!RainmeterPluginBang "MeasureRecyclebin EmptyBin"]


The measure reads the recyclebin using the plugin.the mouse actions on the meter tell the plugin what to do to the recyclebin.
Just copy the meter and the measure into your file,add the name of the image after "Imagename=" and your done.
Image
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Recycle Bin

Post by jsmorley »

You really are better off with the plugin...

Here is a pretty simple skin that demonstrates how to use it:

[Rainmeter]
Update=100

[Variables]
PlayRecycle=PLAY #CURRENTPATH#Recycle.wav
PlayClick=PLAY #CURRENTPATH#NewClick.wav
First setting some variables for the sound files I want to use. They are in the same folder with the skin

EmptyBinLeftMouseAction=!Execute [!PluginBang "MeasureBinSize OpenBin"][#PlayClick#]
EmptyBinRightMouseAction=!Execute [#PlayClick#]
FullBinLeftMouseAction=!Execute [!PluginBang "MeasureBinSize OpenBin"][#PlayClick#]
FullBinRightMouseAction=!Execute [!PluginBang "MeasureBinSize EmptyBinSilent"][#PlayRecycle#]
Then setting the left mouse and right mouse actions to take depending on if the bin is full or empty.

[MeasureBinSize]
Measure=Plugin
Plugin=RecycleManager.dll
RecycleType=SIZE
Drives=ALL
UpdateDivider=2
Use the plugin to get the total amount of bytes in the bin. I will also use this measure to send !bangs to in order to open or empty the bin later.

[MeasureBinCount]
Measure=Plugin
Plugin=RecycleManager.dll
RecycleType=COUNT
Drives=ALL
UpdateDivider=2
Substitute=".0":""
Use this measure to call the plugin to get the number of files in the bin.

[MeterBinEmpty]
Meter=Image
ImageName=RecycleEmpty.png
X=(130 - 40)
Y=0
W=40
H=40
AntiAlias=1
DynamicVariables=1
Hidden=0
LeftMouseUpAction=#EmptyBinLeftMouseAction#
RightMouseUpAction=#EmptyBinRightMouseAction#
This is the image displayed when the bin is empty. You can see the mouse actions on it

[MeterBinFull]
Meter=Image
ImageName=RecycleFull.png
X=(130 - 40)
Y=0
W=40
H=40
AntiAlias=1
DynamicVariables=1
Hidden=1
LeftMouseUpAction=#FullBinLeftMouseAction#
RightMouseUpAction=#FullBinRightMouseAction#
This is the image displayed when the bin is full. It is hidden by default, but will be unhidden by the [BinAction] measure at the very bottom of the skin if there are things in the bin. Again, you can see the mouse actions on it.

[MeterTextFull]
Meter=String
MeasureName=MeasureBinSize
MeasureName2=MeasureBinCount
X=0
Y=6
FontFace=Trebuchet MS
FontSize=11
FontColor=255,255,255,255
AntiAlias=1
StringStyle=BOLD
StringAlign=LEFT
AutoScale=1
Text=Files: %2#CRLF#Size: %1B
LeftMouseUpAction=#FullBinLeftMouseAction#
RightMouseUpAction=#FullBinRightMouseAction#
This text is displayed if the bin is full. I also put mouse actions on it, so you can click on the image or the text.

[MeterTextEmpty]
Meter=String
MeasureName=MeasureBinSize
X=0
Y=6
FontFace=Trebuchet MS
FontSize=11
FontColor=255,255,255,255
AntiAlias=1
StringStyle=NORMAL
StringAlign=LEFT
AutoScale=1
Hidden=1
Text=Recycle#CRLF#Bin Empty
LeftMouseUpAction=#EmptyBinLeftMouseAction#
RightMouseUpAction=#EmptyBinRightMouseAction#
This text is displayed if the bin is empty. I also put mouse actions on it, so you can click on the image or the text. This starts hidden, but will be displayed as needed by [BinAction] below.

[BinAction]
Measure=Calc
Formula=MeasureBinSize
IfAboveAction=!execute [!HideMeter MeterBinEmpty][!ShowMeter MeterBinFull][!HideMeter MeterTextEmpty][!ShowMeter MeterTextFull]
IfAboveValue=0
IfEqualAction=!execute [!HideMeter MeterBinFull][!ShowMeter MeterBinEmpty][!HideMeter MeterTextFull][!ShowMeter MeterTextEmpty]
IfEqualValue=0
This measure checks the value returned by the plugin in [MeasureBinSize] and hides or unhides the correct meters.

Here are the images and sound files:
RecycleEmpty.png
RecycleFull.png
wavefiles.zip
Hope this helps. Obviously you can mess with fonts and colors and positioning and such as you like.
You do not have the required permissions to view the files attached to this post.
brunogasparsc
Posts: 22
Joined: June 28th, 2011, 4:38 pm

Re: Recycle Bin

Post by brunogasparsc »

Thank you very much!
Bgdrls
Posts: 66
Joined: April 29th, 2011, 1:03 am

Re: Recycle Bin

Post by Bgdrls »

If i want to skin play empty bin sound only if RB is "full" (not to play sound if RB is empty), by clicking on text (not on .png), what is the formula to disable sound on empty bin?

In this example skin play sound even if is epmty:

Code: Select all

[MeterTitle]
Meter=STRING
X=0
Y=0
Text="Recycle Bin"
LeftMouseUpAction=!Execute [!RainmeterPluginBang "measureBinItems OpenBin"]
RightMouseUpAction=!Execute [!RainmeterPluginBang "measureBinItems EmptyBinSilent"][#PlayRecycle#]
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Recycle Bin

Post by jsmorley »

Bgdrls wrote:If i want to skin play empty bin sound only if RB is "full" (not to play sound if RB is empty), by clicking on text (not on .png), what is the formula to disable sound on empty bin?

In this example skin play sound even if is epmty:

Code: Select all

[MeterTitle]
Meter=STRING
X=0
Y=0
Text="Recycle Bin"
LeftMouseUpAction=!Execute [!RainmeterPluginBang "measureBinItems OpenBin"]
RightMouseUpAction=!Execute [!RainmeterPluginBang "measureBinItems EmptyBinSilent"][#PlayRecycle#]
You sorta have two choices. In my skin sample above, you can see that I use an approach of hiding an "empty" meter when the bin has things in it, and hiding a "full" meter when not. Then I can put a different mouse action on each. You could easily have one with a sound and one not. The second approach, if you wanted one general meter for text with mouse actions, is to have the Calc measure that detects if the bin is full or empty (like my [BinAction] above) do a !SetVariable to change a variable containing a definition of what you want the RightMouseUpAction to do. Just set the variable with a sound if full and without if not, and then in the meter use that variable on the call to LeffMouseUpAction.

Is that reasonably clear? I can give examples if you need it.

Note: There are probably a dozen other ways you could come at this as well, but these are two reasonable obvious ones.
Bgdrls
Posts: 66
Joined: April 29th, 2011, 1:03 am

Re: Recycle Bin

Post by Bgdrls »

jsmorley wrote:!SetVariable to change a variable containing a definition of what you want the RightMouseUpAction to do. Just set the variable with a sound if full and without if not, and then in the meter use that variable on the call to RightMouseUpAction.
Tnx for the tips, but not clear enough for me. Example would be nice. TIA :)
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: Recycle Bin

Post by Kaelri »

Bgdrls wrote: Tnx for the tips, but not clear enough for me. Example would be nice. TIA :)

Code: Select all

[Variables]
PlayRecycle=

[MeasureBinCount]
Measure=Plugin
Plugin=RecycleManager.dll
RecycleType=COUNT
Drives=ALL

[MeasureFull]
Measure=Calc
Formula=MeasureBinCount
IfAboveValue=0
IfAboveAction=!SetVariable PlayRecycle "PLAY full.wav"
IfEqualValue=0
IfEqualAction=!SetVariable PlayRecycle " "
And remember to set DynamicVariables=1 on your meter.
Bgdrls
Posts: 66
Joined: April 29th, 2011, 1:03 am

Re: Recycle Bin

Post by Bgdrls »

I get it work now. Tnx a lot Kaelri/jsmorley :)