It is currently March 28th, 2024, 3:56 pm

Launching a skin from another skin

Get help with creating, editing & fixing problems with skins
User avatar
Joker73
Posts: 14
Joined: May 17th, 2017, 6:04 pm

Re: Launching a skin from another skin

Post by Joker73 »

balala wrote:Are you sure this is needed? I mean with a such option, the image shown by the skin can be distorted if it has another aspect ratio then the screen and is too big. Usually it's not a good idea to create such large skins.
Instead didn't want to change the Position parameter of the !SetWallpaper bang?
Fill option works fine, thanks!
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Launching a skin from another skin

Post by balala »

You know. But I still think that using a skin as large as the screen is not a good idea.
User avatar
Joker73
Posts: 14
Joined: May 17th, 2017, 6:04 pm

Re: Launching a skin from another skin

Post by Joker73 »

balala wrote:You know. But I still think that using a skin as large as the screen is not a good idea.
Because may it cause performances issues?
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Launching a skin from another skin

Post by balala »

Joker73 wrote:Because may it cause performances issues?
In some cases maybe, but not necessary, especially if you kept the Update set to -1. But if you have a so large skin, how will you see the newly set wallpapers. At least for me it's weird. But finally you know what you wish.
User avatar
Joker73
Posts: 14
Joined: May 17th, 2017, 6:04 pm

Re: Launching a skin from another skin

Post by Joker73 »

balala wrote:In some cases maybe, but not necessary, especially if you kept the Update set to -1. But if you have a so large skin, how will you see the newly set wallpapers. At least for me it's weird. But finally you know what you wish.
Yup, I found this issue too. I used your code to create a image viewer instead of a wallpaper. I think I've finished my dock skin with some hidden docks. Thank you!
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Launching a skin from another skin

Post by balala »

The last code definitely sets the wallpapers. You just have to reduce the size of the skin.
User avatar
Cusanus
Posts: 10
Joined: February 7th, 2018, 7:08 am

Re: Launching a skin from another skin

Post by Cusanus »

Thought this might work, but it only seems to unload the current skin, whereas, I'd like to click on a meter in the current skin and have it exchange it for another skin. After many hours, I found this and tried using this statement:

MouseUpAction[!ToggleConfig "My Projector" "SystemInfo.ini"]

MyProjector is the folder name for the two ini files, Projector.ini and SystemInfo.ini. The idea was to dump the Projector skin and load the SystemInfo skin, but all that happens is that the current skin is dumped. Is it possible to have the other ini loaded as well?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Launching a skin from another skin

Post by jsmorley »

Here is one approach. It uses a tiny plugin I wrote called ConfigActive.

Install this example and the plugin will be installed for your use in your skins.
ToggleTwoSkins_1.0.rmskin
(86.19 KiB) Downloaded 25 times
GIF.gif

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]

[CheckActive]
Measure=Plugin
Plugin=ConfigActive
Disabled=1

[MeasureToggle]
Measure=Calc
Disabled=1
UpdateDivider=-1
DynamicVariables=1
IfCondition=[&CheckActive:IsActive(ToggleTwoSkins\Skin1)]=1
IfTrueAction=[!DeactivateConfig "ToggleTwoSkins\Skin1"][!ActivateConfig "ToggleTwoSkins\Skin2" "Skin2.ini"]
IfCondition2=[&CheckActive:IsActive(ToggleTwoSkins\Skin2)]=1
IfTrueAction2=[!DeactivateConfig "ToggleTwoSkins\Skin2"][!ActivateConfig "ToggleTwoSkins\Skin1" "Skin1.ini"]
IfCondition3=([&CheckActive:IsActive(ToggleTwoSkins\Skin1)]=-1) && ([&CheckActive:IsActive(ToggleTwoSkins\Skin2)]=-1)
IfTrueAction3=[!ActivateConfig "ToggleTwoSkins\Skin1" "Skin1.ini"]

[MeterToggle]
Meter=String
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Toggle Skins
LeftMouseUpAction=[!EnableMeasure MeasureToggle][!UpdateMeasure MeasureToggle]
This is just a simple example that toggles two skins that are in subfolders under the main ToggleTwoSkin config, but you can easily change it to check for and activate & deactivate any configs / skins you like.

It loads one of the skins if neither are active...

Details on using ConfigActive are at: https://forum.rainmeter.net/viewtopic.php?p=141968#p141968

There are certainly other approaches that might not require a plugin, but I am uncertain of how truly reliable they can be if they can't "know" that a particular config is loaded or not. Feels like you would have to make some assumptions, or brute-force a result, which can end up with some annoying error messages in the log.

Note that this requires that the skins be in different config folders. This will not work to toggle two skin .ini files that are in the same config.
User avatar
raiguard
Posts: 660
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA
Contact:

Re: Launching a skin from another skin

Post by raiguard »

I recently wrote a LUA script for loading/unloading skins. You can specify a specific variant (INI) to toggle. The post for it is here.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Launching a skin from another skin

Post by jsmorley »

raiguard wrote:I recently wrote a LUA script for loading/unloading skins. You can specify a specific variant (INI) to toggle. The post for it is here.
My only concern with that approach is that it makes the assumption that Rainmeter.ini is encoded as ANSI or UTF-8. That may not be true in the future, and Lua will not be able to read or parse Rainmeter.ini.

We have an interest, not fully decided yet, to encode Rainmeter.ini as UTF-16 LE, to support Unicode characters in config folder names.
Post Reply