It is currently May 7th, 2021, 12:22 pm

How to make my code shows or hides skin dependence on htere is or is not plugged disc hdd or pendrive. Second things is

General topics related to Rainmeter.
kkmks
Posts: 11
Joined: October 1st, 2016, 4:33 pm

How to make my code shows or hides skin dependence on htere is or is not plugged disc hdd or pendrive. Second things is

Post by kkmks »

How to make my code shows or hides skin dependence on htere is or is not plugged disc hdd or pendrive.

Second things is , when i put pen with a long name my skin change it name but sometimes i need to refresh skin by ppm to reveal long names


My code:

Code: Select all

[Variables]
fontcolor=255, 255, 255, 255
FontFace=Tahoma
FontFace2=Calibri
FontHeight=10
AntiAlias=1
drive="D:"


;############## CODE ##############################################

[DriveFree]
Measure=FreeDiskSpace
Drive=#drive#
IgnoreRemovable=0

[DriveLabel]
Drive=#drive#
Measure=FreeDiskSpace
Label=1
IgnoreRemovable=0

[HDDimage]
Meter=IMAGE
X=0
Y=0
ImageName=hdd.png
LeftMouseUpAction=!Execute ["#drive#\"]

[label]
MeasureName=DriveLabel
Meter=string
X=56r
Y=10r
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace#
Text="%1 (#drive#)"
StringStyle=BOLD
AntiAlias=1
AutoScale=1


[leftText]
MeasureName=DriveFree
Meter=STRING
X=0r
Y=15r
FontColor=#FontColor#
FontSize=#FontHeight#
StringAlign=LEFT
FontFace=#FontFace2#
Text="Free:  %1B"
Percentual=0
AntiAlias=1
AutoScale=1

User avatar
balala
Rainmeter Sage
Posts: 12635
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to make my code shows or hides skin dependence on htere is or is not plugged disc hdd or pendrive. Second thing

Post by balala »

kkmks wrote:How to make my code shows or hides skin dependence on htere is or is not plugged disc hdd or pendrive.
Add the following measure to your code:

Code: Select all

[DriveTotal]
Measure=FreeDiskSpace
Drive=#drive#
Total=1
IgnoreRemovable=0
IfCondition=(DriveTotal>0)
IfTrueAction=[!ShowFade "#CURRENTCONFIG#"]
IfFalseAction=[!HideFade "#CURRENTCONFIG#"]
This measure returns the total size of the appropriate drive. If this is 0, it's assumed that the drive is not present. In this case the skin is hidden (by the IfFalseAction). If the total size of the drive is not 0 (is greater), the drive is present and the skin is shown by the IfTrueAction.
kkmks wrote:Second things is , when i put pen with a long name my skin change it name but sometimes i need to refresh skin by ppm to reveal long names
Just add a [Snippet]DynamicWindowSize=1[/Snippet] option to the [Rainmeter] section of your skin. This will ensure that the size of the skin is updated when the long name must be shown.
kkmks
Posts: 11
Joined: October 1st, 2016, 4:33 pm

Re: How to make my code shows or hides skin dependence on htere is or is not plugged disc hdd or pendrive. Second thing

Post by kkmks »

hmm, i have something like this

Image

the edge of monitor is not problem, beacuse i have next one
the issue is that even after yours suggestion applied i still have issue, when i apply pen which name i long like on screenshoot windows.next the label dont get longer only shows before size and new text is unseen all unil i refresh manualy


in rainmeter i have update = 10000
and your sugestion
User avatar
balala
Rainmeter Sage
Posts: 12635
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to make my code shows or hides skin dependence on htere is or is not plugged disc hdd or pendrive. Second thing

Post by balala »

kkmks wrote:in rainmeter i have update = 10000
and your sugestion
I have one single monitor, so I can't test what's happening at the edge of the monitor.
But Update=10000 means one update per 10 seconds. This will make the skin to need up to 10 seconds to be updated and the label to appear. Maybe first try to reduce this value to the default Update=1000 and see if this helps.
kkmks
Posts: 11
Joined: October 1st, 2016, 4:33 pm

Re: How to make my code shows or hides skin dependence on htere is or is not plugged disc hdd or pendrive. Second thing

Post by kkmks »

ive made better img

Image

what updates:
text value in meaning of string loaded to memory

what does not:
text label width, when there is needed more place 4 longer string than before
manually ppm on skin element and refresh fix this but .... its not how i wanted it to worked


any other possible fix ?
-does my discs need to be saved as skin in rainmeter menu?
-maybe i need to add update not to rainmeter main progrram session but to each hdd volume element ?
-or add to yours show/hide code element to update skin on true ?

btw. thx 4 helping
User avatar
balala
Rainmeter Sage
Posts: 12635
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to make my code shows or hides skin dependence on htere is or is not plugged disc hdd or pendrive. Second thing

Post by balala »

I'm not sure what should be done, but please pack your config and upload it. I'd like to check.
kkmks
Posts: 11
Joined: October 1st, 2016, 4:33 pm

Re: How to make my code shows or hides skin dependence on htere is or is not plugged disc hdd or pendrive. Second thing

Post by kkmks »

Here you have
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 12635
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to make my code shows or hides skin dependence on htere is or is not plugged disc hdd or pendrive. Second thing

Post by balala »

The DynamicWindowSize=1 option is not added to none of the ini files. In fact just the HDD-f.ini has a [Rainmeter] section, but even that's completely empty. That's why the long labels don't become completely visible when you plug in a drive.
So, add to the [Rainmeter] section of HDD-f.ini, the DynamicWindowSize=1 option and also add to all other ini files (from HHD-c.ini to HDD-l.ini, excepting HDD-f.ini) the following section:

Code: Select all

[Rainmeter]
DynamicWindowSize=1
Refresh all loaded skins.

Another thing: you should create a @Resources folder into the root folder (HDDstatus\@Resources) then should move one of the hdd.pngs there (one of them - any) and remove all others. Then replace the ImageName option of the [HDDimage] with the following one: ImageName=#@#hdd.png. This way you'll avoid the need to have 10 times the same file into the skin's folder and all skins would use the hdd.png from the @Resources folder (details).

And one more: what I'd do about your skins would be to unify all those ini files into one single. Using the trick I posted above, you can easily hide the unused / not present drives. Please let me know if you're interested into something like this.
kkmks
Posts: 11
Joined: October 1st, 2016, 4:33 pm

Re: How to make my code shows or hides skin dependence on htere is or is not plugged disc hdd or pendrive. Second thing

Post by kkmks »

i add it to main file option in rainmeter not in every skin will try your way.

Yeah it sounds great to have everything in one place ;)

Now i have another difficulty , skin dont shows when i mount virtual cd in x volume ( ive added x drive folder)
for removable i just add IgnoreRemovable is there any like this thing to cdrom ?
best if it ll be to random volume but 4 me it could be only to 1 specific disc
im using winemucd to mount or sometimes imagex//gimagex
4 now ive add type=6 but could it be set only when inserted drive is not hdd or pen ?





about refresh - will it be working if ill add to your show/hide code [!redraw] after true return ??
User avatar
balala
Rainmeter Sage
Posts: 12635
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to make my code shows or hides skin dependence on htere is or is not plugged disc hdd or pendrive. Second thing

Post by balala »

kkmks wrote:Yeah it sounds great to have everything in one place ;)
Ok, a bit later I'll post a such code.
kkmks wrote:Now i have another difficulty , skin dont shows when i mount virtual cd in x volume ( ive added x drive folder)
for removable i just add IgnoreRemovable is there any like this thing to cdrom ?
best if it ll be to random volume but 4 me it could be only to 1 specific disc
im using winemucd to mount or sometimes imagex//gimagex
4 now ive add type=6 but could it be set only when inserted drive is not hdd or pen ?
FreeDiskSpace doesn't entirely support CDROMs (read the Note here). However a trick could be used to avoid this, I'll try it to implement and will come back with an answer.
kkmks wrote:about refresh - will it be working if ill add to your show/hide code [!redraw] after true return ??
The refresh and the [!redraw] bang have nothing to do with each other. You can add a [!redraw] bang on the IfTrueAction and IfFalseAction options, but that's not so important, because at the end of each update cycle, the skin is redrawn.