It is currently July 17th, 2019, 1:40 pm

Lua script activating/deactivating a different skin?

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

Lua script activating/deactivating a different skin?

Yamajac » June 30th, 2014, 8:48 am

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: 1937
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Lua script activating/deactivating a different skin?

smurfier » June 30th, 2014, 1:49 pm

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: 19287
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Lua script activating/deactivating a different skin?

jsmorley » June 30th, 2014, 2:25 pm

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

Re: Lua script activating/deactivating a different skin?

Yamajac » July 2nd, 2014, 3:40 am

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: 19287
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Lua script activating/deactivating a different skin?

jsmorley » July 2nd, 2014, 4:14 am

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
Yamajac
Posts: 6
Joined: June 30th, 2014, 8:44 am

Re: Lua script activating/deactivating a different skin?

Yamajac » July 2nd, 2014, 4:32 am

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: 19287
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Lua script activating/deactivating a different skin?

jsmorley » July 2nd, 2014, 4:37 am

Glad to help.