It is currently April 19th, 2024, 12:43 am

Automatically loading a skin

Get help with creating, editing & fixing problems with skins
User avatar
CyberTheWorm
Posts: 860
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Automatically loading a skin

Post by CyberTheWorm »

OK Guru's here's one for you.
I trying to write a skin that will load a skin when it detect a new drive has been plugged in. e.g USB drive. Then loads a skin and removes it when the drive is unplugged.

I have got it to work but get warnings when I refresh the skin.

Code: Select all

[MeasureDriveFExists]
Measure=FreeDiskSpace
IgnoreRemovable=0
Drive=F:
Type=1
IfAboveValue=1
IfAboveAction=[!ActivateConfig "SmallSkin\Drives\F" "Drive.ini"]
IfBelowValue=2
IfBelowAction=[!DeactivateConfig "SmallSkin\Drives\F" "Drive.ini"]
Is there a better way to do this?
The only source of knowledge is experience. Albert Einstein
Deviant Art Page
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Automatically loading a skin

Post by kyriakos876 »

CyberTheWorm wrote:OK Guru's here's one for you.
I trying to write a skin that will load a skin when it detect a new drive has been plugged in. e.g USB drive. Then loads a skin and removes it when the drive is unplugged.

I have got it to work but get warnings when I refresh the skin.

Code: Select all

[MeasureDriveFExists]
Measure=FreeDiskSpace
IgnoreRemovable=0
Drive=F:
Type=1
IfAboveValue=1
IfAboveAction=[!ActivateConfig "SmallSkin\Drives\F" "Drive.ini"]
IfBelowValue=2
IfBelowAction=[!DeactivateConfig "SmallSkin\Drives\F" "Drive.ini"]
Is there a better way to do this?
I don't know if there is a best way to do this, but you can for sure add:

Code: Select all

LogSubstringErrors=0
to your measure as those warnings, I guess, are from not finding more than one drives.
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Automatically loading a skin

Post by FreeRaider »

What kind of warnings?

Are you sure about this "If measure > 1 do !activateconfig, if measure < 2 do !deactivateconfig"?
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Automatically loading a skin

Post by balala »

CyberTheWorm wrote:

Code: Select all

IfBelowValue=2
IfBelowAction=[!DeactivateConfig "SmallSkin\Drives\F" "Drive.ini"]
The !DeactivateConfig bang doesn't need a File parameter (in this case "Drive.ini"), as the !ActivateConfig needs. It always unloads the currently loaded skin, of the given config. Replace the IfBelowAction option with the following one: IfBelowAction=[!DeactivateConfig "SmallSkin\Drives\F"].
User avatar
CyberTheWorm
Posts: 860
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: Automatically loading a skin

Post by CyberTheWorm »

FreeRaider wrote:What kind of warnings?

Are you sure about this "If measure > 1 do !activateconfig, if measure < 2 do !deactivateconfig"?
e.PNG
You do not have the required permissions to view the files attached to this post.
The only source of knowledge is experience. Albert Einstein
Deviant Art Page
User avatar
GioRgSaVv
Posts: 62
Joined: February 7th, 2017, 10:02 pm

Re: Automatically loading a skin

Post by GioRgSaVv »

does this work? Im also interested in creating a similar skin that autohides all the unplugged drives and shows all plugged drives.
User avatar
CyberTheWorm
Posts: 860
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: Automatically loading a skin

Post by CyberTheWorm »

GioRgSaVv wrote:does this work? Im also interested in creating a similar skin that autohides all the unplugged drives and shows all plugged drives.
yes it does, just get the warnings shown above. My OCD just want's that to go away.
The only source of knowledge is experience. Albert Einstein
Deviant Art Page