It is currently April 19th, 2024, 6:05 pm

Auto-sizing 'Image' Meter...?

Get help with creating, editing & fixing problems with skins
ZaLiTH
Posts: 8
Joined: September 8th, 2010, 7:08 am

Auto-sizing 'Image' Meter...?

Post by ZaLiTH »

I'm playing with the Gnometer config that came with Rainmeter, and I've converted the disk config to only display drives that exist (for the sake of listing removable drives as well), but I've hit a bit of a blank now.. :(

Is there any way to get a "Meter=Image" to set the height in relation to the number of active meters...? Or perhaps there's another way to do it. Hopefully this request will spark some interest with the likes of people that like to think outside the box.. ;)

Just to show what I've been working on, below is an excerpt from my modified 'disk.ini' file:

The measures:

Code: Select all

[NameDisk1]
IgnoreRemovable=0
Measure=FreeDiskSpace
Drive=#disks.Drive1#
Label=1

[MeasureDisk1]
IgnoreRemovable=0
Measure=FreeDiskSpace
Drive=#disks.Drive1#

[CountDisk1]
IgnoreRemovable=0
Measure=Calc
Formula=MeasureDisk1
IfBelowValue=1
IfBelowAction=!execute [!RainmeterHideMeter Disk1Label][!RainmeterHideMeter Disk1Right][!RainmeterHideMeter Disk1Bar]
IfAboveValue=0
IfAboveAction=!execute [!RainmeterShowMeter Disk1Label][!RainmeterShowMeter Disk1Right][!RainmeterShowMeter Disk1Bar]
The meters:

Code: Select all

[Disk1Label]
Meter=STRING
MeterStyle=TextLeftStyle
Y=#h.Item#
MeasureName=NameDisk1
Label=1
Prefix="#disks.Drive1#\ "
LeftMouseUpAction=!Execute ["#disks.Drive1#"]
MouseActionCursor=1

[Disk1Right]
Meter=STRING
MeterStyle=TextRightStyle
MeasureName=MeasureDisk1

[Disk1Bar]
Meter=BAR
MeterStyle=SeperatorStyle
MeasureName=MeasureDisk1
All drive meters after this have "Y=5r", assuming a computer always has a "C:\", everything will always line up, even if there is no "D:\" but there is a "E:\", this cascades throughout the list.

:!: Can I perhaps set a measure to simply count the number of drives that are displayed in the config? Let's call this hidden meter "CountDisks" for this example: when the ShowMeter bang is executed, I could add a counter to the "CountDisks" measure, and then use the total value of "CountDisks" in the "H" setting for the background "Meter=Image".

But... I'm not sure how to do that. :( I've read through the online help, but either what I'm looking for doesn't exist, or I'm just not seeing it. Any ideas?


Edit:
Could I possibly use the "!RainmeterSetVariable" bang command inside the "IfBelowAction" and "IfAboveAction" bangs to do this?

Or should I rather change from using "!RainmeterShowMeter" to "!RainmeterEnableMeasure" and use one "!RainmeterSetVariable" in each of the measures instead?
[color=#FF0000][center]Don't bother replying to any of my posts, I'm not using this profile anymore.[/center][/color]
ZaLiTH
Posts: 8
Joined: September 8th, 2010, 7:08 am

Re: Auto-sizing 'Image' Meter...?

Post by ZaLiTH »

Played with the config a bit more, and I found another possible solution, but I still need some help with it... Here's what I've got so far:

For the measures:

Code: Select all

[NameDisk1]
IgnoreRemovable=0
Measure=FreeDiskSpace
Drive=#disks.Drive1#
Label=1

[MeasureDisk1]
IgnoreRemovable=0
Measure=FreeDiskSpace
Drive=#disks.Drive1#

[CountDisk1]
IgnoreRemovable=0
Measure=Calc
Formula=MeasureDisk1
IfBelowValue=1
IfBelowAction=!execute [!RainmeterHideMeter Disk1]
IfAboveValue=0
IfAboveAction=!execute [!RainmeterShowMeter Disk1]
For the meters:

Code: Select all

[Disk1]
@Include=Disk1.inc
Contents of 'Disk1.inc':

Code: Select all

[Disk1Label]
Meter=STRING
MeterStyle=TextLeftStyle
Y=5r
MeasureName=NameDisk1
Label=1
Prefix="#disks.Drive1#\ "
LeftMouseUpAction=!Execute ["#disks.Drive1#"]
MouseActionCursor=1

[Disk1Right]
Meter=STRING
MeterStyle=TextRightStyle
MeasureName=MeasureDisk1

[Disk1Bar]
Meter=BAR
MeterStyle=SeperatorStyle
MeasureName=MeasureDisk1
Everything lines up correctly when I manually exclude one of the '@include' statements, but it seems the 'IfBelowAction' and 'IfAboveStatements' aren't doing what I need them to. Is there a way to use '@include' within the 'IfAboveAction' statement instead? I tried last night, but I couldn't get it to work..
[color=#FF0000][center]Don't bother replying to any of my posts, I'm not using this profile anymore.[/center][/color]
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Auto-sizing 'Image' Meter...?

Post by poiru »

You can't use [!RainmeterHideMeter Disk1] because you don't have a Disk1 meter.. You need to hide all meters (Disk1Left, Disk1Right, Disk1Label).

You could have something like this:
[Variables]
Height1=0
Height2=0
Height3=0
...

Then, for each disk measure (so you set Height1 to 0 if it doesn't exist, and some other value if it does):
[CountDisk1]
Measure=Calc
Formula=MeasureDisk1
IfBelowValue=1
IfBelowAction=!execute [!RainmeterHideMeter Disk1Label][!RainmeterHideMeter Disk1Right][!RainmeterHideMeter Disk1Left][!RainmeterSetVariable Height1 0]
IfAboveValue=0
IfAboveAction=!execute [!RainmeterShowMeter Disk1Label][!RainmeterShowMeter Disk1Right][!RainmeterShowMeter Disk1Left][!RainmeterSetVariable Height1 50]

Then, on the IMAGE:
H=(#Height1#+#Height2#+#Height3#)
DynamicVariables=1

I unfortunately don't have the time to test this, but I think it should work. The problem: say Disk2 doesn't exist. In this case Disk3 will stay in place (i.e. there will be a gap between Disk1 meters and Disk3 meters). I might know how it can be done, but can't test right now..
ZaLiTH
Posts: 8
Joined: September 8th, 2010, 7:08 am

Re: Auto-sizing 'Image' Meter...?

Post by ZaLiTH »

poiru wrote:You can't use [!RainmeterHideMeter Disk1] because you don't have a Disk1 meter.. You need to hide all meters (Disk1Left, Disk1Right, Disk1Label).
Thanks, I actually missed that part... When I tried that particular way it was already close on 2am, so I wasn't really thinking straight. Lol..
poiru wrote:You could have something like this:
[Variables]
Height1=0
Height2=0
Height3=0
...

Then, for each disk measure (so you set Height1 to 0 if it doesn't exist, and some other value if it does):
[CountDisk1]
Measure=Calc
Formula=MeasureDisk1
IfBelowValue=1
IfBelowAction=!execute [!RainmeterHideMeter Disk1Label][!RainmeterHideMeter Disk1Right][!RainmeterHideMeter Disk1Left][!RainmeterSetVariable Height1 0]
IfAboveValue=0
IfAboveAction=!execute [!RainmeterShowMeter Disk1Label][!RainmeterShowMeter Disk1Right][!RainmeterShowMeter Disk1Left][!RainmeterSetVariable Height1 50]

Then, on the IMAGE:
H=(#Height1#+#Height2#+#Height3#)
DynamicVariables=1

I unfortunately don't have the time to test this, but I think it should work. The problem: say Disk2 doesn't exist. In this case Disk3 will stay in place (i.e. there will be a gap between Disk1 meters and Disk3 meters). I might know how it can be done, but can't test right now..
Thanks for the suggestion, I didn't think of it from that angle... I'll try that tonight and see how it turns out. :)
[color=#FF0000][center]Don't bother replying to any of my posts, I'm not using this profile anymore.[/center][/color]