It is currently March 28th, 2024, 10:47 am

Help inserting recycle bin into skin

Get help with creating, editing & fixing problems with skins
Post Reply
ss4adib
Posts: 2
Joined: June 17th, 2017, 6:44 pm

Help inserting recycle bin into skin

Post 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:
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help inserting recycle bin into skin

Post 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.
ss4adib
Posts: 2
Joined: June 17th, 2017, 6:44 pm

Re: Help inserting recycle bin into skin

Post by ss4adib »

That worked amazing thanks!
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help inserting recycle bin into skin

Post by balala »

Glad to help.
UltimateRayon
Posts: 1
Joined: May 6th, 2020, 10:00 am

Re: Help inserting recycle bin into skin

Post 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}
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Help inserting recycle bin into skin

Post 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#
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help inserting recycle bin into skin

Post by jsmorley »

Here is an example skin:

Recycle_1.0.rmskin
(510.46 KiB) Downloaded 62 times

1.jpg
Post Reply