Page 1 of 1

Help inserting recycle bin into skin

Posted: June 17th, 2017, 6:52 pm
by ss4adib
So im using this awesome rainmeter skin/dock by hysteria27 http://hysteria27.deviantart.com/art/Simple53-447658404 and am trying to add an icon for recycle bin that changes according to whether its full or empty.

When I add the following code it just makes a recycle bin appear in the top left of the screen but it seems to be totally separate to the skin and doesn't work as it should.

Code: Select all

[Variables]
 ;--------------
 ; Application 1
 ;--------------
   AppIcon1=Alienhead.png
   AppName1=This PC
   AppPath1=explorer.exe
   BgColor1=000000
 ;--------------
 ; Application 2
 ;--------------
   AppIcon2=[recyclebin]
   AppName2=Recycle Bin
   AppPath2=::{645FF040-5081-101B-9F08-00AA002F954E}
   BgColor2=FF0000
 ;--------------
 ; Application 3
 ;--------------
   AppIcon3=Google Chrome.png
   AppName3=Google Chrome
   AppPath3=C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
   BgColor3=F4C20D
 ;--------------
 ; Application 4
 ;--------------
   AppIcon4=Word.png
   AppName4=Microsoft Word
   AppPath4=winword.exe
   BgColor4=2B5796
 ;--------------
 ; Application 5
 ;--------------
   AppIcon5=Photoshop.png
   AppName5=Adobe Photoshop
   AppPath5=C:\Program Files\Adobe\Adobe Photoshop CC 2017\Photoshop.exe
   BgColor5=0C5fA1

[recyclebin]
Meter=Image
DynamicVariables=1
LeftMouseUpAction=[::{645FF040-5081-101B-9F08-00AA002F954E}]

[Measure]
Measure=Plugin
Plugin=RecycleManager
RecycleType=Count
DynamicVariables=1
IfCondition=Measure = 0
IfTrueAction=[!SetOption recyclebin ImageName "Recycle Bin Empty.png"][!Redraw]
IfFalseAction=[!SetOption recyclebin ImageName "Recycle Bin Full.png"][!Redraw]
What im basically trying to do is get AppIcon2 to be a recycle bin icon that changes according to bin status.

Any help would be greatly appreciated :thumbup:

Re: Help inserting recycle bin into skin

Posted: June 17th, 2017, 7:19 pm
by balala
Not sure at all what you wanted to achieve with the AppIcon2=[recyclebin] option, but [recyclebin] being a meter, you can't attribute it to a variable (AppIcon2 in this case). If I don't misinterpreting what you would like, I'd say you have to replace the IfTrueAction and IfFalseAction options of the [Measure] measure, as it follows:

Code: Select all

[Measure]
...
IfCondition=Measure = 0
IfTrueAction=[!SetVariable AppIcon2 "Recycle Bin Empty.png"][!Redraw]
IfFalseAction=[!SetVariable AppIcon2 "Recycle Bin Full.png"][!Redraw]
Take care to have both the Recycle Bin Empty.png and Recycle Bin Full.png images.
If you do so, you either should remove the [!Redraw] bangs, or better, add an !UpdateMeter (or eventually an !UpdateMeasure) bang, to update the section where the AppIcon2 variable is used.
Also be careful to not forget to add a DynamicVariables=1 option to the same section (meter or measure). When you're using a dynamically set variable, this option is absolutely required on the meter or measure where you're using the variable. Without it, that section won't properly work.

Re: Help inserting recycle bin into skin

Posted: June 17th, 2017, 7:52 pm
by ss4adib
That worked amazing thanks!

Re: Help inserting recycle bin into skin

Posted: June 17th, 2017, 8:15 pm
by balala
Glad to help.

Re: Help inserting recycle bin into skin

Posted: May 6th, 2020, 10:12 am
by UltimateRayon
Help me anyone please.. want to use 2 image for recycle bin whether it's empty or contain something

[MidIcon2]
Meter = Image
MeterStyle = MainIconStyle | MidIconStyle
ImageName = #@#Icons\#MidIconName2#
LeftMouseUpAction= ::{645FF040-5081-101B-9F08-00AA002F954E}

Re: Help inserting recycle bin into skin

Posted: May 6th, 2020, 11:19 am
by mak_kawa
Hi UltimateRayon

To know recycle bin is whether empty or not, you have to use RecycleManager measure. and switch image file according to recycle-bin item count, already described in the first post of this thread, like as;

Code: Select all

[measureBinItems]
Measure=RecycleManager
RecycleType=Count
IfCondition=measureBinItems <> 0
IfTrueAction=[!SetVariable MidIconName2 (Icon file name for non-empty)]
IfFalseAction=[!SetVariable MidIconName2 (Icon file name for empty)]

[MidIcon2]
Meter=Image
MeterStyle=MainIconStyle | MidIconStyle
ImageName=#@#Icons\#MidIconName2#

Re: Help inserting recycle bin into skin

Posted: May 6th, 2020, 11:44 am
by jsmorley
Here is an example skin:

Recycle_1.0.rmskin

1.jpg