It is currently May 2nd, 2024, 9:13 am

Button to switch between themes

Get help with creating, editing & fixing problems with skins
CooLMinE
Posts: 3
Joined: September 18th, 2010, 5:22 am

Button to switch between themes

Post by CooLMinE »

Hey all, basically I was looking for a way to create a button so it disables all the configs when pressed, basically to reduce the cpu usage before entering a game, since with enough configs running cpu usage hovers around 5-10%.

Alex over at #rainmeter gave me an idea, the button could be used to switch between themes which should be easier in the long run (instead of disabling configs).

Since my coding abilities as far as rainmeter goes are kinda limited and haven't found any examples when researching around to try and tailor them for my needs, here i am :)

Basically what I'm looking for is for a button (small image) that when I press it will load a theme with only that particular button loaded (as far as appearance goes at least, I'm assuming the code behind it needs to be different in order to load the default theme when pressed again), hopefully that should stop any cpu usage since there wont be any configs running apart from the button one. Then basically when you press the button again the original (default) theme will be loaded back with all the configs.

Any help would be greatly appreciated, thanks in advance :)
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: Button to switch between themes

Post by Chewtoy »

While you could load a different theme, which will probably keep it easier when designing new setups, you could just as well use !RainmeterToggleConfig.

!RainmeterToggleConfig [Config] [Ini-file]
Toggles the configuration ini-file.


So you basically create an image-meter where you set
LeftMouseUpAction=!Execute [!RainmeterToggleConfig Gnometer\System System.ini][!RainmeterToggleConfig Enigma\Taskbar\Clock Time.ini]
This will toggle the two skins Time.ini from enigma and System.ini from gnometer.

There is no !Bang to change the theme at the moment, so to do that you will have to right click on the trayicon -> Themes and there select a theme.
You can take a look at the available !Bangs here: http://rainmeter.net/cms/Bangs_beta (you need the latest beta for all of them to work, so make sure your rev matches the one on the main page).
I don't think, therefore I'm not.
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Button to switch between themes

Post by poiru »

Chewtoy wrote:There is no !Bang to change the theme at the moment, so to do that you will have to right click on the trayicon -> Themes and there select a theme.
You can take a look at the available !Bangs here: http://rainmeter.net/cms/Bangs_beta (you need the latest beta for all of them to work, so make sure your rev matches the one on the main page).
But RainThemes has a switch to change themes.

Try
!Execute ["#ADDONSPATH#\RainThemes\RainThemes.exe" /LOAD "ThemeName"]

If I were you, I'd create a small app to launch Rainmeter if it's closed and vice versa. This way you could have a shortcut to 'toggle' Rainmeter. Let me know if you'd like that, and I'll make it.
CooLMinE
Posts: 3
Joined: September 18th, 2010, 5:22 am

Re: Button to switch between themes

Post by CooLMinE »

I already stumbled upon !RainmeterToggleConfig, think another user was trying to do something similar. The thing about !RainmeterToggleConfig is that you will need to enter the name of each config which in my case its more than 15 and the major issue is that for someone like me that likes to changes the configs pretty often it means that I'll be changing that parameter a few times per week :p

Although I guess if there's no parameter for it there no way around it is there :)

@Chewtoy, Thanks for offering to do something like that, but at the moment I'm trying to see if something like this is possible without using any extra applications or launch buttons outside rainmeter, I'll give the /load command a try to see if it works.

LeftMouseDownAction=!execute ["#dir#\util\fileExec.exe" "taskkill.exe /IM Rainmeter.exe /f" "%%#dir#\util\rText.exe%% %%(?i)(\[HUD\.Vision\\)(.+)(\\.+\])|$1White$3%% %%#rainmeter_dir#\Rainmeter.ini%%" "%%#rainmeter_dir#\Rainmeter.exe%%" -eawms3000-swhide][!RainmeterRefresh]
This is a part from Jiri's HUD.Vision switch config, which basically was used to switch from black to white etc, at first I was trying to modify it around to get the result I was looking for but sadly I was unsuccessful, probably messed up somewhere. Throwing it here in case it gives an idea to someone :)
CooLMinE
Posts: 3
Joined: September 18th, 2010, 5:22 am

Re: Button to switch between themes

Post by CooLMinE »

And done :) RainThemes.exe /LOAD worked perfectly, thank you both :)

edit: Basically both advises work extremely good, so in the end it's down to preference and how often you switch your configs around. If you rarely do !RainmeterToggleConfig is probably better because there's no 3~sec delay that you need to switch between themes (I'm a perfectionist don't think about it :p) but if you keep changing your configs quite often rainthemes /load will probably be easier in the long run.

Nevertheless, spot on answers, thanks again :)