It is currently April 25th, 2024, 5:06 pm

Lua script activating/deactivating a different skin?

Discuss the use of Lua in Script measures.
User avatar
Yamajac
Posts: 134
Joined: June 30th, 2014, 8:44 am

Lua script activating/deactivating a different skin?

Post by Yamajac »

Is that possible? I can't seem to figure out how to do it. It would trivialize my current project, but it just doesn't seem possible..
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Lua script activating/deactivating a different skin?

Post by smurfier »

SKIN:Bang('!ActivateConfig', 'ConfigName', 'Skin.ini')

SKIN:Bang('!DeactivateConfig', 'ConfigName')

SKIN:Bang('!ToggleConfig', 'ConfigName', 'Skin.ini')
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Lua script activating/deactivating a different skin?

Post by jsmorley »

Smurfier has it exactly right. Basically, anything you can do in a skin with bangs, you can also do in Lua.
User avatar
Yamajac
Posts: 134
Joined: June 30th, 2014, 8:44 am

Re: Lua script activating/deactivating a different skin?

Post by Yamajac »

smurfier wrote:SKIN:Bang('!ActivateConfig', 'ConfigName', 'Skin.ini')

SKIN:Bang('!DeactivateConfig', 'ConfigName')

SKIN:Bang('!ToggleConfig', 'ConfigName', 'Skin.ini')

But that doesn't work, at all. I've tried it. It won't toggle the skins, for whatever reason.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Lua script activating/deactivating a different skin?

Post by jsmorley »

I assure you it does work. You have to be careful that you understand and use the correct "ConfigName" for the skin you are trying to toggle. Also, don't forget that Lua is always case sensitive, so be careful of case when using commands. SKIN:Bang (good) | Skin:Bang (fail).

http://docs.rainmeter.net/manual/skins#Config
User avatar
Yamajac
Posts: 134
Joined: June 30th, 2014, 8:44 am

Re: Lua script activating/deactivating a different skin?

Post by Yamajac »

jsmorley wrote:I assure you it does work. You have to be careful that you understand and use the correct "ConfigName" for the skin you are trying to toggle. Also, don't forget that Lua is always case sensitive, so be careful of case when using commands. SKIN:Bang (good) | Skin:Bang (fail).

http://docs.rainmeter.net/manual/skins#Config

Yeah, I can get every other bang to work with lua, but just not this one. It just doesn't work for whatever reason. I thought maybe toggling skins just doesn't work in lua, but I suppose I'm just doing something wrong. Probably got some quotes in the wrong place or something.

Whatever the case, I have managed to make a workaround that works better than the lua option regardless, so all is well. Thanks for your help.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Lua script activating/deactivating a different skin?

Post by jsmorley »

Glad to help.