It is currently March 28th, 2024, 5:51 pm

Tray Icon in 2.3 r1304

Report bugs with the Rainmeter application and suggest features.
dragonmage
Developer
Posts: 1270
Joined: April 3rd, 2009, 4:31 am
Location: NC, US

Re: Tray Icon in 2.3 r1304

Post by dragonmage »

Mordasius wrote: Thank you for that. ...nothing makes me feel more of a dimwit than waking up to find I've suggested a feature that alreay exists :oops:
Technically if you wanted to you could have the tray icon be a drop that fills according to CPU usage. http://rainmeter.net/cms/Settings-TrayMeasure_beta?hl=traybitmap
User avatar
Mordasius
Posts: 1167
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Tray Icon in 2.3 r1304

Post by Mordasius »

dragonmage wrote:Technically if you wanted to you could have the tray icon be a drop that fills according to CPU usage. http://rainmeter.net/cms/Settings-TrayMeasure_beta?hl=traybitmap
Shauo, that's going way over what I need to see in the System Tray, but it certainly proves the point about doing a search of the manual (beta) before posting dum comments.
r0k
Posts: 78
Joined: March 9th, 2012, 10:06 am

Re: Tray Icon in 2.3 r1304

Post by r0k »

No no, you are not dumb.
Or I'm dumb too :D
Well, if i have to be dumb, better not being dumb alone.
But this leaves an important question unanswered : who's Dumb and who's Dumber? :p

Hum, maybe i should stop posting silly comments and start doing something constructive. :handtohead:
esteve_pep@yahoo.es
Posts: 7
Joined: August 31st, 2017, 3:21 pm

Re: Tray Icon in 2.3 r1304

Post by esteve_pep@yahoo.es »

HI, I'm just new on Rainmeter, I know how to change the tray icon, but I want to change it by a different one depending on the space usage. It's like a HD usage meter on the tray. I tried several things, but I'm not able to make TrayBitmap variable and so changing the icon based on calculations. I've tried with histogram, but the proble is that I can see progress but the color does not change (always fixed). Any one knows? Many thx in advance.
My code looks like this (well a simplified versión of it):

[Rainmeter]
SkinPath=C:\Users\.....\Documents\Rainmeter\Skins\
Language=1033
Update=1000

[Variables]
IconA=Icons\Barblue16.ico

[TrayMeasure]
Measure=Calc
TrayMeter=BITMAP
TrayBitmap=IconA
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: Tray Icon in 2.3 r1304

Post by SilverAzide »

You forgot the variable delimiters:
TrayBitmap=#IconA#
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Tray Icon in 2.3 r1304

Post by eclectic-tech »

esteve_pep@yahoo.es wrote:HI, I'm just new on Rainmeter, I know how to change the tray icon, but I want to change it by a different one depending on the space usage. It's like a HD usage meter on the tray. I tried several things, but I'm not able to make TrayBitmap variable and so changing the icon based on calculations. I've tried with histogram, but the proble is that I can see progress but the color does not change (always fixed). Any one knows? Many thx in advance.
My code looks like this (well a simplified versión of it):

[Rainmeter]
SkinPath=C:\Users\.....\Documents\Rainmeter\Skins\
Language=1033
Update=1000

[Variables]
IconA=Icons\Barblue16.ico

[TrayMeasure]
Measure=Calc
TrayMeter=BITMAP
TrayBitmap=IconA
SilverAzide beat me on one issue ;-)

Besides that issue, you need to use a measure that returns a single value; your 'Calc' measure does not have a 'Formula', so it returns zero value.

To return disk space, you could use

Code: Select all

[TrayMeasure]
Measure=FreeDiskSpace
Drive=C:
InvertMeasure=1
TrayMeter=BITMAP
TrayBitmap=Icons\BarBlue16.ico
This measure will return the used space on your C: drive as a percentage. BarBlue16 should be a bitmap image with 100 16x16 frames each displaying an increased used space.

Alternately, you could define TrayBitmap=Icons\BarBlue%i.ico This would require having 100 individual '.ico' type files in a folder 'Skins\Icons', each named BarBlue1.ico to BarBlue100.ico; each file somehow indicating the percent of used space.

I may be mistaken, but I do not think you can use (or even want to use) a [Variables] section in the main Rainmeter.ini file.

Hope this helps a bit...
esteve_pep@yahoo.es
Posts: 7
Joined: August 31st, 2017, 3:21 pm

Re: Tray Icon in 2.3 r1304

Post by esteve_pep@yahoo.es »

Hi,

Yes, #...# did work. :D :D , I should have realised before... Thanks for the quick answer.
esteve_pep@yahoo.es
Posts: 7
Joined: August 31st, 2017, 3:21 pm

Re: Tray Icon in 2.3 r1304

Post by esteve_pep@yahoo.es »

eclectic-tech wrote:SilverAzide beat me on one issue ;-)

Besides that issue, you need to use a measure that returns a single value; your 'Calc' measure does not have a 'Formula', so it returns zero value.

To return disk space, you could use

Code: Select all

[TrayMeasure]
Measure=FreeDiskSpace
Drive=C:
InvertMeasure=1
TrayMeter=BITMAP
TrayBitmap=Icons\BarBlue16.ico
This measure will return the used space on your C: drive as a percentage. BarBlue16 should be a bitmap image with 100 16x16 frames each displaying an increased used space.

Alternately, you could define TrayBitmap=Icons\BarBlue%i.ico This would require having 100 individual '.ico' type files in a folder 'Skins\Icons', each named BarBlue1.ico to BarBlue100.ico; each file somehow indicating the percent of used space.

I may be mistaken, but I do not think you can use (or even want to use) a [Variables] section in the main Rainmeter.ini file.

Hope this helps a bit...
JES wrote: That helped me, now I have to figure out how to set ranges to have only 3 bitmaps (i.e Green from 0 to 60, Orange from 60 to 80, Red from 80 to 100). I've tried the below, but it does not work. Still investigating. Thanks for your help. :thumbup:

[Rainmeter]
SkinPath=C:\Users\...\Documents\Rainmeter\Skins\
Language=1033
Update=1000
Logging=1

[Variables]
IconA=Icons\Bargreen16.ico

[MeasureDiskPercentFullC]
Measure=FreeDiskSpace
Drive=C:
InvertMeasure=1
IfCondition=(MeasureDiskPercentFullC >= 0.8)
IfTrueAction=[!WriteKeyValue "Variable" "IconA" "Icons\Barred16.ico"]
IfCondition2=(MeasureDiskPercentFullC >= 0.6) && (MeasureDiskPercentFullC < 0.8)
IfTrueAction2=[!WriteKeyValue "Variable" "IconA" "Icons\Barorange16.ico"]
IfCondition3=(MeasureDiskPercentFullC < 0.6)
IfTrueAction3=[!WriteKeyValue "Variable" "IconA" "Icons\Bargreen16.ico"]

[TrayMeasure]
Measure=Calc
TrayMeter=BITMAP
TrayBitmap=#IconA#
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Tray Icon in 2.3 r1304

Post by eclectic-tech »

Add just this to Rainmeter.ini settings file:

Code: Select all

[TrayMeasure]
Measure=FreeDiskSpace
Drive=C:
InvertMeasure=1
TrayMeter=BITMAP
TrayBitmap=Icons\Bar16.bmp

Here is a png version of how the bitmap image appears: 40% green, next 40% orange, last 20% red.
bar16.png
Download and extract this compressed Bitmap as "bar16.bmp" to your "Skins\Icons" folder. Then "Refresh All".
bar16.bmp.zip
(309 Bytes) Downloaded 27 times
As an alternate to downloading and extracting, you could easily create your own 16x160 bitmap colored with the percentages you want. :thumbup:
esteve_pep@yahoo.es
Posts: 7
Joined: August 31st, 2017, 3:21 pm

Re: Tray Icon in 2.3 r1304

Post by esteve_pep@yahoo.es »

That helped a lot. Many thx for this. At least I can show percentage of disk used with color coding. I still want to show differents icons depending on percentage of disk full (one icon for less tan 40%, one icon for between 40 and 80 and one icon for more tan 80). If you know how it will be even better, but at least I've something. Many thx again.
Post Reply