It is currently April 23rd, 2024, 5:25 pm

Is it possible to use !ShowMeter Bang to show a meter in a different skin

Get help with creating, editing & fixing problems with skins
Morsmodre
Posts: 22
Joined: December 14th, 2020, 3:04 am

Is it possible to use !ShowMeter Bang to show a meter in a different skin

Post by Morsmodre »

What I want to do is this: I want to setup a toggle in 'Skin A' that shows a meter included in 'Skin B', with !ShowMeter Bang. I wanted to know if this possible.

This is what I've tried doing in 'Skin A':
LeftMouseUpAction=[!ShowMeter "[Meter]" "Skin B\Skin B.ini"]

This hasn't worked, though
User avatar
SilverAzide
Rainmeter Sage
Posts: 2604
Joined: March 23rd, 2015, 5:26 pm

Re: Is it possible to use !ShowMeter Bang to show a meter in a different skin

Post by SilverAzide »

Yes, this is possible. The problem is that you did not reference the meter correctly. The name of a section (meter or measure) does not include the square brackets. So just use:

Code: Select all

LeftMouseUpAction=[!ShowMeter "Meter" "Skin B\Skin B.ini"]
Gadgets Wiki GitHub More Gadgets...
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Is it possible to use !ShowMeter Bang to show a meter in a different skin

Post by balala »

SilverAzide wrote: January 6th, 2021, 6:32 pm

Code: Select all

LeftMouseUpAction=[!ShowMeter "Meter" "Skin B\Skin B.ini"]
Unfortunately this doesn't work this way, because the last parameter has to be the name of the appropriate config, not the name and path of the skin's file. So instead of LeftMouseUpAction=[!ShowMeter "Meter" "Skin B\Skin B.ini"], the option should look like this: LeftMouseUpAction=[!ShowMeter "Meter" "Skin B"], where Skin B is the name of the config (colored green above), not the name of the skin (red above).
Additionally I'd add a !Redraw bang with the same config parameter: LeftMouseUpAction=[!ShowMeter "Meter" "Skin B][!Redraw "Skin B"]
Morsmodre
Posts: 22
Joined: December 14th, 2020, 3:04 am

Re: Is it possible to use !ShowMeter Bang to show a meter in a different skin

Post by Morsmodre »

balala wrote: January 6th, 2021, 6:48 pm
Unfortunately this doesn't work this way, because the last parameter has to be the name of the appropriate config, not the name and path of the skin's file. So instead of LeftMouseUpAction=[!ShowMeter "Meter" "Skin B\Skin B.ini"], the option should look like this: LeftMouseUpAction=[!ShowMeter "Meter" "Skin B"], where Skin B is the name of the config (colored green above), not the name of the skin (red above).
Additionally I'd add a !Redraw bang with the same config parameter: LeftMouseUpAction=[!ShowMeter "Meter" "Skin B][!Redraw "Skin B"]
SilverAzide wrote: January 6th, 2021, 6:32 pm Yes, this is possible. The problem is that you did not reference the meter correctly. The name of a section (meter or measure) does not include the square brackets. So just use:

Code: Select all

LeftMouseUpAction=[!ShowMeter "Meter" "Skin B\Skin B.ini"]
Thanks a lot guys :) It works perfectly after removing the brackets and path of skin.

I have one more question: I want a skin that allows to switch b/w Light and Dark windows theme. I took some code from 'powerplan switcher' skin of Khanhas's Notch suite: https://github.com/khanhas/Notch
powerplan skin: https://github.com/khanhas/Notch/blob/master/Themes/Notch/Assets/powerPlanSwitcher.ini
It uses PowershellRM plugin.

Code: Select all

[Rainmeter]
Update=1000

[Variables]
@Include=#@#MainBarVariables.inc
PlanZoneStart = 135

[PSRM]
Measure = plugin
Plugin = PowershellRM
ScriptFile = #@#BrightnessPowerPlan.ps1
UpdateDivider = -1

[GetThemeMode]
Measure = Plugin
Plugin = powershellrm
Parent = PSRM
Line = GetThemeMode
; Ancient Windows
IfCondition    = GetThemeMode = -1
IfTrueAction   = [!HideMeterGroup ThemeMode][!SetVariable PlanZoneStart 85][!UpdateMeter *][!Redraw]
; Dark theme
IfCondition2   = GetThemeMode = 0
IfTrueAction2  = [!SetOption Dark FontColor "#Color_Scheme3#"][!SetOption Light FontColor "#Color_Scheme2#"][!UpdateMeter Dark][!UpdateMeter Light][!Redraw]
; Light theme
IfCondition3   = GetThemeMode = 1
IfTrueAction3  = [!SetOption Light FontColor "#Color_Scheme3#"][!SetOption Dark FontColor "#Color_Scheme2#"][!UpdateMeter Dark][!UpdateMeter Light][!Redraw]

[Mode]
Meter=String
Text=App mode:
FontFace=#Font_Face#
FontColor=#Color_Scheme2#50
FontSize=(#Font_Size#*10/12)
AntiAlias=1
StringAlign=LeftBottom
X=#SubSkinPadding#
Y=30R
Group = ThemeMode

[Light]
Meter = String
Text=Light
FontFace=#Font_Face#
FontWeight=800
FontColor=#Color_Scheme2#
FontSize=#Font_Size#
AntiAlias=1
StringAlign=LeftBottom
Y=r
X=40R
LeftMouseDownAction=[!CommandMeasure PSRM "SetThemeMode 1"][!UpdateMeasure GetThemeMode]
Group = ThemeMode

[Dark]
Meter=String
MeterStyle=Light
Text=Dark
LeftMouseDownAction=[!CommandMeasure PSRM "SetThemeMode 0"][!UpdateMeasure GetThemeMode]
It works well when I load it first time. But, when I restart PC, Rainmeter crashes with this skin loaded. I have to delete this skin, and PowershellRM plugin to open Rainmeter. What am I doing wrong here? And, Is there any other way to switch windows themes?