It is currently May 25th, 2020, 2:32 pm

App Launcher for access with remote control

General topics related to Rainmeter.
Wolfson
Posts: 16
Joined: April 18th, 2020, 2:00 pm

Re: App Launcher for access with remote control

Post by Wolfson »

balala wrote:
April 22nd, 2020, 8:58 am
Probably you should disable the HotKey plugin measures when another application is started and re-enable it when the application is closed. However take care that you can't do this through !DisableMeasure / !EnableMeasure bangs, these bangs don't disable / enable a HotKey plugin measure. Disabling / enabling them can be done through the following bangs:
  • Disabling: [!CommandMeasure "MeasureHotKeyUp" "Stop"]
  • Enabling: [!CommandMeasure "MeasureHotKeyUp" "Start"]
Note that you have to add four such !CommandMeasure bangs, one for each plugin measure ([MeasureHotKeyUp], [MeasureHotKeyDown], [MeasureHotKeyRight] and [MeasureHotKeyLeft])
Do you know how to check if the application is running? If you don't know, let us know, to help you.

Not knowing the whole code, it is practically impossible to tell why. So please for first post the whole code of the skin.
Thanks a lot balala for the help! That looks good. I will try to find the right spot to add the commands you provided. Regarding the process-check, I don't know yet how to do it, but will try to find out. Help is of course always welcome :)

The code currently looks like this:

Code: Select all

; ========= Metadata ==========
[Metadata]
Name=
Author=
Information=
; BY=attribution / SA=share-alike / ND=no-derivatives / NC=non-commercial
License=CC BY-SA-NC 3.0
Version=

; ========= Variables ==========
[Variables]
process1=C:\Program Files\TrueConf\Client\TrueConf.exe
process2=C:\Users\bla\Desktop\some.url
process3=C:\Users\bla\Desktop\Diashow.exe
process4=

activatekey=ENTER
; Set by skin actions
selected=1
alpha1=255
alpha2=75
alpha3=75
alpha4=75

; ========= Skin Settings ==========
[Rainmeter]
Update=10000
AccurateText=1
DynamicWindowSize=1
Group=#RootConfig#

OnRefreshAction=[!Move "0" "0"][!ZPos 0]

; ========= Measures ==========
[MeasureHotKeyUp]
Measure=Plugin
Plugin=HotKey
HotKey=UP
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#-2,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyDown]
Measure=Plugin
Plugin=HotKey
HotKey=DOWN
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#+2,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyRight]
Measure=Plugin
Plugin=HotKey
HotKey=RIGHT
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#+1,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyLeft]
Measure=Plugin
Plugin=HotKey
HotKey=LEFT
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#-1,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyActivateProcess]
Measure=Plugin
Plugin=HotKey
HotKey=#activatekey#
;ShowAllKeys=1
KeyUpAction=["[#process[#selected]]"]
DynamicVariables=1

[MeasureAlpha]
Measure=Calc
Formula=#selected#
IfCondition=(#selected#=1)
IfTrueAction=[!SetVariable Alpha1 255][!SetVariable Alpha2 55][!SetVariable Alpha3 55][!SetVariable Alpha4 55][!UpdateMeter *][!Redraw]
IfCondition2=(#selected#=2)
IfTrueAction2=[!SetVariable Alpha1 55][!SetVariable Alpha2 255][!SetVariable Alpha3 55][!SetVariable Alpha4 55][!UpdateMeter *][!Redraw]
IfCondition3=(#selected#=3)
IfTrueAction3=[!SetVariable Alpha1 55][!SetVariable Alpha2 55][!SetVariable Alpha3 255][!SetVariable Alpha4 55][!UpdateMeter *][!Redraw]
IfCondition4=(#selected#=4)
IfTrueAction4=[!SetVariable Alpha1 55][!SetVariable Alpha2 55][!SetVariable Alpha3 55][!SetVariable Alpha4 255][!UpdateMeter *][!Redraw]
IfConditionMode=1
DynamicVariables=1

; ========= Meter Styles ==========
[TextStyle]
StringCase=Upper
StringAlign=CenterCenter
StringStyle=Bold
StringEffect=Border
FontSize=36
DynamicVariables=1


; ========= Meters ==========
[Background]
Meter=Image
X=1
Y=1
W=(#WorkAreaWidth#-2)
H=(#WorkAreaHeight#-2)
SolidColor=0,0,0

[MeterImage1]
Meter=Image
ImageName=#@#Images\Phone.png
DynamicVariables=1
X=1
Y=1
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=200,50,50,#alpha1#
AntiAlias=1

[MeterImage2]
Meter=Image
DynamicVariables=1
X=R
Y=r
W=([Background:W]*0.5)
H=([Background:H]*0.5)
ImageName=#@#Images\Lahoe.png
SolidColor=50,50,200,#alpha2#
AntiAlias=1

[MeterImage3]
Meter=Image
ImageName=#@#Images\Diashow.png
DynamicVariables=1
X=1
Y=R
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=200,50,200,#alpha3#
AntiAlias=1

[MeterImage4]
Meter=Image
DynamicVariables=1
X=R
Y=r
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=200,200,50,#alpha4#
AntiAlias=1

User avatar
balala
Rainmeter Sage
Posts: 10577
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: App Launcher for access with remote control

Post by balala »

Wolfson wrote:
April 22nd, 2020, 7:00 pm
I will try to find the right spot to add the commands you provided.
Ok, let me know if any question arises.
Wolfson wrote:
April 22nd, 2020, 7:00 pm
Regarding the process-check, I don't know yet how to do it, but will try to find out. Help is of course always welcome :)
You have to add the following measure:

Code: Select all

[MeasureProcess]
Measure=Plugin
Plugin=Process
ProcessName=ADD-THE-NAME-OF-THE-PROCESS
IfCondition=(#CURRENTSECTION#>0)
IfTrueAction=[!CommandMeasure "MeasureHotKeyUp" "Stop"][!CommandMeasure "MeasureHotKeyDown" "Stop"][!CommandMeasure "MeasureHotKeyRight" "Stop"][!CommandMeasure "MeasureHotKeyLeft" "Stop"]
IfFalseAction=[!CommandMeasure "MeasureHotKeyUp" "Start"][!CommandMeasure "MeasureHotKeyDown" "Start"][!CommandMeasure "MeasureHotKeyRight" "Start"][!CommandMeasure "MeasureHotKeyLeft" "Start"]
Take care to add the name of the process which should disable / enable the HotKey plugin measures.
Wolfson
Posts: 16
Joined: April 18th, 2020, 2:00 pm

Re: App Launcher for access with remote control

Post by Wolfson »

balala wrote:
April 22nd, 2020, 7:39 pm
Ok, let me know if any question arises.

You have to add the following measure:

Code: Select all

[MeasureProcess]
Measure=Plugin
Plugin=Process
ProcessName=ADD-THE-NAME-OF-THE-PROCESS
IfCondition=(#CURRENTSECTION#>0)
IfTrueAction=[!CommandMeasure "MeasureHotKeyUp" "Stop"][!CommandMeasure "MeasureHotKeyDown" "Stop"][!CommandMeasure "MeasureHotKeyRight" "Stop"][!CommandMeasure "MeasureHotKeyLeft" "Stop"]
IfFalseAction=[!CommandMeasure "MeasureHotKeyUp" "Start"][!CommandMeasure "MeasureHotKeyDown" "Start"][!CommandMeasure "MeasureHotKeyRight" "Start"][!CommandMeasure "MeasureHotKeyLeft" "Start"]
Take care to add the name of the process which should disable / enable the HotKey plugin measures.
Thanks for the very fast help!
I've meanwhile tried to get it to work, but even if the variables that I've created (proc1run, proc2run ...) are populated correctly, the `[MeasureCheckProcess]` somehow does not work. I will try to add your solution now. My current one looks like this:

Code: Select all

; ========= Metadata ==========
[Metadata]
Name=
Author=
Information=
; BY=attribution / SA=share-alike / ND=no-derivatives / NC=non-commercial
License=CC BY-SA-NC 3.0
Version=

; ========= Variables ==========
[Variables]
process1=C:\Program Files\TrueConf\Client\TrueConf.exe
process2=C:\Users\AsRock BeeBox\Desktop\Lahoe.url
process3=C:\Users\AsRock BeeBox\Desktop\Diashow.exe
process4=
proc1run=0
proc2run=0
proc3run=0
proc4run=0

activatekey=ENTER
; Set by skin actions
selected=1
alpha1=255
alpha2=75
alpha3=75
alpha4=75

; ========= Skin Settings ==========
[Rainmeter]
Update=10000
BackgroundMode=2
AccurateText=1
DynamicWindowSize=1
Group=#RootConfig#

OnRefreshAction=[!Move "0" "0"][!ZPos 0]

; ========= Measures ==========
[MeasureProcessPluginTrueConf]
Measure=Plugin
Plugin=Process
ProcessName=TrueConf.exe
IfEqualValue=1
IfEqualAction=[!SetVariable proc1run 1]
IfEqualValue=-1
IfEqualAction=[!SetVariable proc1run 0]

[MeasureProcessPluginFF]
Measure=Plugin
Plugin=Process
ProcessName=firefox.exe
IfEqualValue=1
IfEqualAction=[!SetVariable proc2run 1]
IfEqualValue=-1
IfEqualAction=[!SetVariable proc2run 0]

[MeasureProcessPluginSlideshow]
Measure=Plugin
Plugin=Process
ProcessName=Slideshow.exe
IfEqualValue=1
IfEqualAction=[!SetVariable proc3run 1]
IfEqualValue=-1
IfEqualAction=[!SetVariable proc3run 0]

[MeasureHotKeyUp]
Measure=Plugin
Plugin=HotKey
HotKey=UP
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#-2,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyDown]
Measure=Plugin
Plugin=HotKey
HotKey=DOWN
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#+2,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyRight]
Measure=Plugin
Plugin=HotKey
HotKey=RIGHT
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#+1,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyLeft]
Measure=Plugin
Plugin=HotKey
HotKey=LEFT
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#-1,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyActivateProcess]
Measure=Plugin
Plugin=HotKey
HotKey=#activatekey#
;ShowAllKeys=1
KeyUpAction=["[#process[#selected]]"]
DynamicVariables=1

[MeasureCheckProcess]
Measure=Calc
Formula=1
IfCondition=(#proc1run#=1) || (#proc2run#=1) || (#proc3run#=1)
IfTrueAction=[!CommandMeasure "MeasureHotKeyUp" "Stop"][!CommandMeasure "MeasureHotKeyDown" "Stop"][!CommandMeasure "MeasureHotKeyRight" "Stop"][!CommandMeasure "MeasureHotKeyLeft" "Stop"][!CommandMeasure "MeasureHotKeyActivateProcess" "Stop"]
IfCondition2=(#proc1run#=0) && (#proc2run#=0) && (#proc3run#=0)
IfTrueAction2=[!CommandMeasure "MeasureHotKeyUp" "Start"][!CommandMeasure "MeasureHotKeyDown" "Start"][!CommandMeasure "MeasureHotKeyRight" "Start"][!CommandMeasure "MeasureHotKeyLeft" "Start"][!CommandMeasure "MeasureHotKeyActivateProcess" "Start"]

[MeasureAlpha]
Measure=Calc
Formula=#selected#
IfCondition=(#selected#=1)
IfTrueAction=[!SetVariable Alpha1 255][!SetVariable Alpha2 55][!SetVariable Alpha3 55][!SetVariable Alpha4 55][!UpdateMeter *][!Redraw]
IfCondition2=(#selected#=2)
IfTrueAction2=[!SetVariable Alpha1 55][!SetVariable Alpha2 255][!SetVariable Alpha3 55][!SetVariable Alpha4 55][!UpdateMeter *][!Redraw]
IfCondition3=(#selected#=3)
IfTrueAction3=[!SetVariable Alpha1 55][!SetVariable Alpha2 55][!SetVariable Alpha3 255][!SetVariable Alpha4 55][!UpdateMeter *][!Redraw]
IfCondition4=(#selected#=4)
IfTrueAction4=[!SetVariable Alpha1 55][!SetVariable Alpha2 55][!SetVariable Alpha3 55][!SetVariable Alpha4 255][!UpdateMeter *][!Redraw]
IfConditionMode=1
DynamicVariables=1

; ========= Meter Styles ==========
[TextStyle]
StringCase=Upper
StringAlign=CenterCenter
StringStyle=Bold
StringEffect=Border
FontSize=36
DynamicVariables=1

; ========= Meters ==========
[Background]
Meter=Image
X=1
Y=1
W=(#WorkAreaWidth#-2)
H=(#WorkAreaHeight#-2)
SolidColor=0,0,0

[MeterImage1]
Meter=Image
ImageName=#@#Images\Phone.png
DynamicVariables=1
X=1
Y=1
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=200,50,50,#alpha1#
AntiAlias=1

[MeterImage2]
Meter=Image
DynamicVariables=1
X=R
Y=r
W=([Background:W]*0.5)
H=([Background:H]*0.5)
ImageName=#@#Images\Lahoe.png
SolidColor=50,50,200,#alpha2#
AntiAlias=1

[MeterImage3]
Meter=Image
ImageName=#@#Images\Diashow.png
DynamicVariables=1
X=1
Y=R
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=200,50,200,#alpha3#
AntiAlias=1

[MeterImage4]
Meter=Image
DynamicVariables=1
X=R
Y=r
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=200,200,50,#alpha4#
AntiAlias=1
User avatar
balala
Rainmeter Sage
Posts: 10577
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: App Launcher for access with remote control

Post by balala »

Wolfson wrote:
April 22nd, 2020, 8:28 pm
I've meanwhile tried to get it to work, but even if the variables that I've created (proc1run, proc2run ...) are populated correctly, the `[MeasureCheckProcess]` somehow does not work.
There is a huge mistake into the IfTrueAction and IfFalseAction options of the mentioned [MeasureCheckProcess] measure: the && characters are not needed between the bangs of these options. So you should remove those characters:

Code: Select all

[MeasureCheckProcess]
Measure=Calc
Formula=1
IfCondition=(#proc1run#=1) || (#proc2run#=1) || (#proc3run#=1)
IfTrueAction=[!CommandMeasure "MeasureHotKeyUp" "Stop"][!CommandMeasure "MeasureHotKeyDown" "Stop"][!CommandMeasure "MeasureHotKeyRight" "Stop"][!CommandMeasure "MeasureHotKeyLeft" "Stop"][!CommandMeasure "MeasureHotKeyActivateProcess" "Stop"]
IfCondition2=(#proc1run#=0) && (#proc2run#=0) && (#proc3run#=0)
IfTrueAction2=[!CommandMeasure "MeasureHotKeyUp" "Start"][!CommandMeasure "MeasureHotKeyDown" "Start"][!CommandMeasure "MeasureHotKeyRight" "Start"][!CommandMeasure "MeasureHotKeyLeft" "Start"][!CommandMeasure "MeasureHotKeyActivateProcess" "Start"]
User avatar
balala
Rainmeter Sage
Posts: 10577
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: App Launcher for access with remote control

Post by balala »

Wolfson wrote:
April 22nd, 2020, 8:28 pm
even if the variables that I've created (proc1run, proc2run ...) are populated correctly,
Additionally note that no, those variables are not set correctly, because you can't use two IfEqualValue / IfEqualAction options onto one single measure, what you did on the [MeasureProcessPluginTrueConf], [MeasureProcessPluginFF] and [MeasureProcessPluginSlideshow] measures. So you should replace these options with the following ones:

Code: Select all

...
IfAboveValue=0
IfAboveAction=[!SetVariable procXrun "1"]
IfBelowValue=0
IfBelowAction=[!SetVariable procXrun "0"]
Wolfson
Posts: 16
Joined: April 18th, 2020, 2:00 pm

Re: App Launcher for access with remote control

Post by Wolfson »

balala wrote:
April 22nd, 2020, 8:50 pm
Additionally note that no, those variables are not set correctly, because you can't use two IfEqualValue / IfEqualAction options onto one single measure, what you did on the [MeasureProcessPluginTrueConf], [MeasureProcessPluginFF] and [MeasureProcessPluginSlideshow] measures. So you should replace these options with the following ones:

Code: Select all

...
IfAboveValue=0
IfAboveAction=[!SetVariable procXrun "1"]
IfBelowValue=0
IfBelowAction=[!SetVariable procXrun "0"]
Thank you so much! Now it works with switching of and on the HotKeys.

Only thing that does not work yet is the navigation, sometimes the arrow keys do what they are supposed to do, sometimes nothing or something else. My current code looks like this:

Code: Select all

; ========= Metadata ==========
[Metadata]
Name=
Author=
Information=
; BY=attribution / SA=share-alike / ND=no-derivatives / NC=non-commercial
License=CC BY-SA-NC 3.0
Version=

; ========= Variables ==========
[Variables]
process1=C:\Program Files\TrueConf\Client\TrueConf.exe
process2=C:\Users\AsRock BeeBox\Desktop\Lahoe.url
process3=C:\Users\AsRock BeeBox\Desktop\Diashow.exe
process4=
checkProc1=TrueConf_GL.exe
checkProc2=firefox.exe
checkProc3=Diashow.exe
proc1run=0
proc2run=0
proc3run=0
proc4run=0
keysOff=0

activatekey=ENTER
; Set by skin actions
selected=1
alpha1=255
alpha2=75
alpha3=75
alpha4=75

; ========= Skin Settings ==========
[Rainmeter]
Update=10000
AccurateText=1
DynamicWindowSize=1
Group=#RootConfig#

OnRefreshAction=[!Move "0" "0"][!ZPos 0]

; ========= Measures ==========
[MeasureProcessPluginProc1]
Measure=Plugin
Plugin=Process
ProcessName=#checkProc1#
IfAboveValue=0
IfAboveAction=[!SetVariable proc1run "1"]
IfBelowValue=0
IfBelowAction=[!SetVariable proc1run "0"]
OnChangeAction=[!UpdateMeasure MeasureCheckProcess]
DynamicVariables=1

[MeasureProcessPluginProc2]
Measure=Plugin
Plugin=Process
ProcessName=#checkProc2#
IfAboveValue=0
IfAboveAction=[!SetVariable proc2run "1"]
IfBelowValue=0
IfBelowAction=[!SetVariable proc2run "0"]
OnChangeAction=[!UpdateMeasure MeasureCheckProcess]
DynamicVariables=1

[MeasureProcessPluginProc3]
Measure=Plugin
Plugin=Process
ProcessName=#checkProc3#
IfAboveValue=0
IfAboveAction=[!SetVariable proc3run "1"]
IfBelowValue=0
IfBelowAction=[!SetVariable proc3run "0"]
OnChangeAction=[!UpdateMeasure MeasureCheckProcess]
DynamicVariables=1

[MeasureHotKeyUp]
Measure=Plugin
Plugin=HotKey
HotKey=UP
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#-2,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyDown]
Measure=Plugin
Plugin=HotKey
HotKey=DOWN
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#+2,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyRight]
Measure=Plugin
Plugin=HotKey
HotKey=RIGHT
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#+1,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyLeft]
Measure=Plugin
Plugin=HotKey
HotKey=LEFT
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#-1,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyActivateProcess]
Measure=Plugin
Plugin=HotKey
HotKey=#activatekey#
;ShowAllKeys=1
KeyUpAction=["[#process[#selected]]"]
DynamicVariables=1

[MeasureCheckProcess]
Measure=Calc
Formula=1
IfCondition=(#proc1run#=1) || (#proc2run#=1) || (#proc3run#=1)
IfTrueAction=[!SetVariable keysOff 1][!CommandMeasure "MeasureHotKeyUp" "Stop"][!CommandMeasure "MeasureHotKeyDown" "Stop"][!CommandMeasure "MeasureHotKeyRight" "Stop"][!CommandMeasure "MeasureHotKeyLeft" "Stop"][!CommandMeasure "MeasureHotKeyActivateProcess" "Stop"]
IfCondition2=(#proc1run#=0) && (#proc2run#=0) && (#proc3run#=0)
IfTrueAction2=[!SetVariable keysOff 0][!CommandMeasure "MeasureHotKeyUp" "Start"][!CommandMeasure "MeasureHotKeyDown" "Start"][!CommandMeasure "MeasureHotKeyRight" "Start"][!CommandMeasure "MeasureHotKeyLeft" "Start"][!CommandMeasure "MeasureHotKeyActivateProcess" "Start"]
DynamicVariables=1

[MeasureAlpha]
Measure=Calc
Formula=#selected#
IfCondition=(#selected#=1)
IfTrueAction=[!SetVariable Alpha1 255][!SetVariable Alpha2 55][!SetVariable Alpha3 55][!SetVariable Alpha4 55][!UpdateMeter *][!Redraw]
IfCondition2=(#selected#=2)
IfTrueAction2=[!SetVariable Alpha1 55][!SetVariable Alpha2 255][!SetVariable Alpha3 55][!SetVariable Alpha4 55][!UpdateMeter *][!Redraw]
IfCondition3=(#selected#=3)
IfTrueAction3=[!SetVariable Alpha1 55][!SetVariable Alpha2 55][!SetVariable Alpha3 255][!SetVariable Alpha4 55][!UpdateMeter *][!Redraw]
IfCondition4=(#selected#=4)
IfTrueAction4=[!SetVariable Alpha1 55][!SetVariable Alpha2 55][!SetVariable Alpha3 55][!SetVariable Alpha4 255][!UpdateMeter *][!Redraw]
IfConditionMode=1
DynamicVariables=1

; ========= Meter Styles ==========
[TextStyle]
StringCase=Upper
StringAlign=CenterCenter
StringStyle=Bold
StringEffect=Border
FontSize=36
DynamicVariables=1

; ========= Meters ==========
[Background]
Meter=Image
X=1
Y=1
W=(#WorkAreaWidth#-2)
H=(#WorkAreaHeight#-2)
SolidColor=0,0,0

[MeterImage1]
Meter=Image
ImageName=#@#Images\Phone.png
DynamicVariables=1
X=1
Y=1
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=200,50,50,#alpha1#
AntiAlias=1

[MeterImage2]
Meter=Image
DynamicVariables=1
X=R
Y=r
W=([Background:W]*0.5)
H=([Background:H]*0.5)
ImageName=#@#Images\Lahoe.png
SolidColor=50,50,200,#alpha2#
AntiAlias=1

[MeterImage3]
Meter=Image
ImageName=#@#Images\Diashow.png
DynamicVariables=1
X=1
Y=R
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=200,50,200,#alpha3#
AntiAlias=1

[MeterImage4]
Meter=Image
DynamicVariables=1
X=R
Y=r
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=200,200,50,#alpha4#
AntiAlias=1
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3930
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: App Launcher for access with remote control

Post by eclectic-tech »

Wolfson wrote:
April 22nd, 2020, 9:16 pm
Thank you so much! Now it works with switching of and on the HotKeys.

Only thing that does not work yet is the navigation, sometimes the arrow keys do what they are supposed to do, sometimes nothing or something else.
You set the skin to Update=10000, so the skin only reacts to changes every 10 seconds... that is partly why you are seeing erratic response.

Change it to default 1000 or perhaps 500 for faster response to actions.

Code: Select all

[Rainmeter]
Update=1000
...
EDIT: In testing your current skin, it monitors several processes, and stops any key actions in the skin when any are active. It is not possible to use the skin to launch one of the other processes if any of the monitored processes are active. For me, this reduces the usefulness of a simple launching panel; ex.: if I open a browser, the skin is disabled until that process is closed, so none of the other 3 processes can be started.

An alternative to monitoring processes, you might want to "stop" all hotkeys when a process is activated, then use OnFocusAction to "Start" actions in the skin. I would also suggest using OnUnfocusAction to "stop" if other windows have focus. The user would only need to "click" on the skin to give it focus, to "Start" hot key actions and activate another process.

You only need to add the "Start" and "Stop" commands to the [Rainmeter] section and the "Stop" commands to the [MeasureHotKeyActivateProcess] section.

Your code with process monitoring removed, and using OnFocusAction/OnUnfocusAction and !CommandMeasure in [Rainmeter] to "Start" and "Stop", and !CommandMeasure in [MeasureHotKeyActivateProcess] to "Stop".

Code: Select all

; ========= Metadata ==========
[Metadata]
Name=
Author=
Information=
; BY=attribution / SA=share-alike / ND=no-derivatives / NC=non-commercial
License=CC BY-SA-NC 3.0
Version=

; ========= Variables ==========
[Variables]
process1=C:\Program Files\TrueConf\Client\TrueConf.exe
process2=C:\Users\AsRock BeeBox\Desktop\Lahoe.url
process3=C:\Users\AsRock BeeBox\Desktop\Diashow.exe
process4=

activatekey=ENTER
; Set by skin actions
selected=1
alpha1=255
alpha2=75
alpha3=75
alpha4=75

; ========= Skin Settings ==========
[Rainmeter]
Update=500
AccurateText=1
DynamicWindowSize=1
Group=#RootConfig#

OnRefreshAction=[!Move "0" "0"][!ZPos 0]

OnFocusAction=[!CommandMeasure MeasureHotKeyUp "Start"][!CommandMeasure MeasureHotKeyDown "Start"][!CommandMeasure MeasureHotKeyLeft "Start"][!CommandMeasure MeasureHotKeyRight "Start"][!CommandMeasure MeasureHotKeyActivateProcess "Start"]

OnUnfocusAction=[!CommandMeasure MeasureHotKeyUp "Stop"][!CommandMeasure MeasureHotKeyDown "Stop"][!CommandMeasure MeasureHotKeyLeft "Stop"][!CommandMeasure MeasureHotKeyRight "Stop"][!CommandMeasure MeasureHotKeyActivateProcess "Stop"]

; ========= Measures ==========
[MeasureHotKeyUp]
Measure=Plugin
Plugin=HotKey
HotKey=UP
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#-2,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyDown]
Measure=Plugin
Plugin=HotKey
HotKey=DOWN
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#+2,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyRight]
Measure=Plugin
Plugin=HotKey
HotKey=RIGHT
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#+1,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyLeft]
Measure=Plugin
Plugin=HotKey
HotKey=LEFT
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#-1,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyActivateProcess]
Measure=Plugin
Plugin=HotKey
HotKey=#activatekey#
;ShowAllKeys=1
KeyUpAction=["[#process[#selected]]"][!CommandMeasure MeasureHotKeyUp "Stop"][!CommandMeasure MeasureHotKeyDown "Stop"][!CommandMeasure MeasureHotKeyLeft "Stop"][!CommandMeasure MeasureHotKeyRight "Stop"][!CommandMeasure MeasureHotKeyActivateProcess "Stop"]
DynamicVariables=1

[MeasureAlpha]
Measure=Calc
Formula=#selected#
IfCondition=(#selected#=1)
IfTrueAction=[!SetVariable Alpha1 255][!SetVariable Alpha2 55][!SetVariable Alpha3 55][!SetVariable Alpha4 55][!UpdateMeter *][!Redraw]
IfCondition2=(#selected#=2)
IfTrueAction2=[!SetVariable Alpha1 55][!SetVariable Alpha2 255][!SetVariable Alpha3 55][!SetVariable Alpha4 55][!UpdateMeter *][!Redraw]
IfCondition3=(#selected#=3)
IfTrueAction3=[!SetVariable Alpha1 55][!SetVariable Alpha2 55][!SetVariable Alpha3 255][!SetVariable Alpha4 55][!UpdateMeter *][!Redraw]
IfCondition4=(#selected#=4)
IfTrueAction4=[!SetVariable Alpha1 55][!SetVariable Alpha2 55][!SetVariable Alpha3 55][!SetVariable Alpha4 255][!UpdateMeter *][!Redraw]
IfConditionMode=1
DynamicVariables=1

; ========= Meter Styles ==========
[TextStyle]
StringCase=Upper
StringAlign=CenterCenter
StringStyle=Bold
StringEffect=Border
FontSize=36
DynamicVariables=1

; ========= Meters ==========
[Background]
Meter=Image
X=1
Y=1
W=(#WorkAreaWidth#-2)
H=(#WorkAreaHeight#-2)
SolidColor=0,0,0

[MeterImage1]
Meter=Image
ImageName=#@#Images\Phone.png
DynamicVariables=1
X=1
Y=1
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=200,50,50,#alpha1#
AntiAlias=1

[MeterImage2]
Meter=Image
DynamicVariables=1
X=R
Y=r
W=([Background:W]*0.5)
H=([Background:H]*0.5)
ImageName=#@#Images\Lahoe.png
SolidColor=50,50,200,#alpha2#
AntiAlias=1

[MeterImage3]
Meter=Image
ImageName=#@#Images\Diashow.png
DynamicVariables=1
X=1
Y=R
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=200,50,200,#alpha3#
AntiAlias=1

[MeterImage4]
Meter=Image
DynamicVariables=1
X=R
Y=r
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=200,200,50,#alpha4#
AntiAlias=1

; [MeterselectTest]
; Meter=String
; Text=#selected#
; MeterStyle=TextStyle
; FontColor=255,255,255
; X=50
; Y=50
Wolfson
Posts: 16
Joined: April 18th, 2020, 2:00 pm

Re: App Launcher for access with remote control

Post by Wolfson »

eclectic-tech wrote:
April 23rd, 2020, 1:25 am
You set the skin to Update=10000, so the skin only reacts to changes every 10 seconds... that is partly why you are seeing erratic response.

Change it to default 1000 or perhaps 500 for faster response to actions.

Code: Select all

[Rainmeter]
Update=1000
...
EDIT: In testing your current skin, it monitors several processes, and stops any key actions in the skin when any are active. It is not possible to use the skin to launch one of the other processes if any of the monitored processes are active. For me, this reduces the usefulness of a simple launching panel; ex.: if I open a browser, the skin is disabled until that process is closed, so none of the other 3 processes can be started.

An alternative to monitoring processes, you might want to "stop" all hotkeys when a process is activated, then use OnFocusAction to "Start" actions in the skin. I would also suggest using OnUnfocusAction to "stop" if other windows have focus. The user would only need to "click" on the skin to give it focus, to "Start" hot key actions and activate another process.

You only need to add the "Start" and "Stop" commands to the [Rainmeter] section and the "Stop" commands to the [MeasureHotKeyActivateProcess] section.

...
Thanks electric-tech for your help! Even though it is a great idea, I can't follow it due to the required click on the skin to get focus. Maybe I should give a bit more background. Everything should be controlled by this very simple remote control. The arrow buttons are mapped to the "up/down/right/left" arrow keys, the "back" button is mapped to "Alt+F4" to close applications and "Ok" is mapped to "Enter". Based on the Power button on the top right, the PC is switched on and off. This is all I have and want to use. Also, it is not necessary to have 2 applications running at the same time. The programs are:
  • True Conf: opens directly in full screen in the contact list, can be navigated with the arrow keys and on Enter, a video call is initiated
  • firefox: opens directly a streaming page in full screen for a specific service
  • Slideshow: opens a slideshow with pictures of the familiy of the man that can regularly be changed via remote access (in this case TeamViewer)
This is all I currently need. So if the man is done with e.g. calling somebody, he should just press "back" and thereby closes the application and then should be able to either run another app or just switch off.
Wolfson
Posts: 16
Joined: April 18th, 2020, 2:00 pm

Re: App Launcher for access with remote control

Post by Wolfson »

Regarding the update speed:
Is the update of the meters itself depend on the rainmeter update? I thought it is decoupled based on using the HotKey that reacts to input and that then calls to update MeasureAlpha, the Meters and Redraws.

Anyway, I've tried to balance between a low update time and using too much CPU (I only have a Intel Atom core). I've now tried it with a low update time in addition to using a Divider. I also tried to minimize the amount of required updates by checking which meter/alpha-value/measure really needs an update depending on which field is currently selected and what was selected before. Unfortunately, as in case with the navigation in general, it only works sometimes....

Maybe you guys see something I did wrong in the current code:

Code: Select all

; ========= Metadata ==========
[Metadata]
Name=
Author=
Information=
; BY=attribution / SA=share-alike / ND=no-derivatives / NC=non-commercial
License=CC BY-SA-NC 3.0
Version=

; ========= Variables ==========
[Variables]
process1=C:\Program Files\TrueConf\Client\TrueConf.exe
process2=C:\Users\AsRock BeeBox\Desktop\Lahoe.url
process3=C:\Users\AsRock BeeBox\Desktop\Diashow.exe
process4=
checkProc1=TrueConf_GL.exe
checkProc2=firefox.exe
checkProc3=Diashow.exe
proc1run=0
proc2run=0
proc3run=0
proc4run=0
keysOff=0
updateDivProc=5

activatekey=ENTER
; Set by skin actions
selected=1
selPrev=4
alpha1=255
alpha2=75
alpha3=75
alpha4=75

; ========= Skin Settings ==========
[Rainmeter]
Update=500
DefaultUpdateDivider=20
AccurateText=1
DynamicWindowSize=1
Group=#RootConfig#

OnRefreshAction=[!Move "0" "0"][!ZPos 0]

; ========= Measures ==========
[MeasureProcessPluginProc1]
Measure=Plugin
Plugin=Process
UpdateDivider=#updateDivProc#
ProcessName=#checkProc1#
IfAboveValue=0
IfAboveAction=[!SetVariable proc1run "1"]
IfBelowValue=0
IfBelowAction=[!SetVariable proc1run "0"]
OnChangeAction=[!UpdateMeasure MeasureCheckProcess]
DynamicVariables=1

[MeasureProcessPluginProc2]
Measure=Plugin
Plugin=Process
UpdateDivider=#updateDivProc#
ProcessName=#checkProc2#
IfAboveValue=0
IfAboveAction=[!SetVariable proc2run "1"]
IfBelowValue=0
IfBelowAction=[!SetVariable proc2run "0"]
OnChangeAction=[!UpdateMeasure MeasureCheckProcess]
DynamicVariables=1

[MeasureProcessPluginProc3]
Measure=Plugin
Plugin=Process
UpdateDivider=#updateDivProc#
ProcessName=#checkProc3#
IfAboveValue=0
IfAboveAction=[!SetVariable proc3run "1"]
IfBelowValue=0
IfBelowAction=[!SetVariable proc3run "0"]
OnChangeAction=[!UpdateMeasure MeasureCheckProcess]
DynamicVariables=1

[MeasureHotKeyUp]
Measure=Plugin
Plugin=HotKey
HotKey=UP
;ShowAllKeys=1
KeyUpAction=[!SetVariable selPrev #selected#][!SetVariable selected (Clamp(#selected#-2,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyDown]
Measure=Plugin
Plugin=HotKey
HotKey=DOWN
;ShowAllKeys=1
KeyUpAction=[!SetVariable selPrev #selected#][!SetVariable selected (Clamp(#selected#+2,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyRight]
Measure=Plugin
Plugin=HotKey
HotKey=RIGHT
;ShowAllKeys=1
KeyUpAction=[!SetVariable selPrev #selected#][!SetVariable selected (Clamp(#selected#+1,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyLeft]
Measure=Plugin
Plugin=HotKey
HotKey=LEFT
;ShowAllKeys=1
KeyUpAction=[!SetVariable selPrev #selected#][!SetVariable selected (Clamp(#selected#-1,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyActivateProcess]
Measure=Plugin
Plugin=HotKey
HotKey=#activatekey#
;ShowAllKeys=1
KeyUpAction=["[#process[#selected]]"]
DynamicVariables=1

[MeasureCheckProcess]
Measure=Calc
Formula=1
IfCondition=(#proc1run#=1) || (#proc2run#=1) || (#proc3run#=1)
IfTrueAction=[!SetVariable keysOff 1][!CommandMeasure "MeasureHotKeyUp" "Stop"][!CommandMeasure "MeasureHotKeyDown" "Stop"][!CommandMeasure "MeasureHotKeyRight" "Stop"][!CommandMeasure "MeasureHotKeyLeft" "Stop"][!CommandMeasure "MeasureHotKeyActivateProcess" "Stop"]
IfCondition2=(#proc1run#=0) && (#proc2run#=0) && (#proc3run#=0)
IfTrueAction2=[!SetVariable keysOff 0][!CommandMeasure "MeasureHotKeyUp" "Start"][!CommandMeasure "MeasureHotKeyDown" "Start"][!CommandMeasure "MeasureHotKeyRight" "Start"][!CommandMeasure "MeasureHotKeyLeft" "Start"][!CommandMeasure "MeasureHotKeyActivateProcess" "Start"]
DynamicVariables=1

[MeasureAlpha]
Measure=Calc
IfCondition=1
IfTrueAction=[!SetVariable Alpha#selected# 255][!SetVariable Alpha#selPrev# 55][!UpdateMeter MeterImage#selected#][!UpdateMeter MeterImage#selPrev#][!Redraw]
IfConditionMode=1
DynamicVariables=1

; ========= Meter Styles ==========
[TextStyle]
StringCase=Upper
StringAlign=CenterCenter
StringStyle=Bold
StringEffect=Border
FontSize=36
DynamicVariables=1

; ========= Meters ==========
[Background]
Meter=Image
UpdateDivider=-1
X=1
Y=1
W=(#WorkAreaWidth#-2)
H=(#WorkAreaHeight#-2)
SolidColor=0,0,0

[MeterImage1]
Meter=Image
ImageName=#@#Images\Phone.png
DynamicVariables=1
X=1
Y=1
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=200,50,50,#alpha1#
AntiAlias=1

[MeterImage2]
Meter=Image
DynamicVariables=1
X=R
Y=r
W=([Background:W]*0.5)
H=([Background:H]*0.5)
ImageName=#@#Images\Lahoe.png
SolidColor=50,50,200,#alpha2#
AntiAlias=1

[MeterImage3]
Meter=Image
ImageName=#@#Images\Diashow.png
DynamicVariables=1
X=1
Y=R
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=200,50,200,#alpha3#
AntiAlias=1

[MeterImage4]
Meter=Image
DynamicVariables=1
X=R
Y=r
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=200,200,50,#alpha4#
AntiAlias=1
User avatar
balala
Rainmeter Sage
Posts: 10577
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: App Launcher for access with remote control

Post by balala »

Wolfson wrote:
April 23rd, 2020, 7:45 am
Regarding the update speed:
Is the update of the meters itself depend on the rainmeter update? I thought it is decoupled based on using the HotKey that reacts to input and that then calls to update MeasureAlpha, the Meters and Redraws.
Normally. Generally speaking a skin is updated regularly (in most cases once a second - if the Update is set to the default Update=1000, but in your case once per ten seconds, as eclectic-tech described) and on each update, the measures and meters are updated, then the skin is redrawn. Why in your case the "navigation" doesn't work properly is the update of different sections of your skin, as described below.
Wolfson wrote:
April 22nd, 2020, 9:16 pm
Only thing that does not work yet is the navigation, sometimes the arrow keys do what they are supposed to do, sometimes nothing or something else. My current code looks like this:
Note that beside eclectic-tech's solution, even if the Update is kept to 10,000, you can achieve a proper update if when you hit an arrow key, you update properly everything you have to update. You've updated only the [MeasureAlpha] measure and all meters, but you also have to update the HotKey plugin measures, because they are using the value of the selected variable. When you hit a key, the value of the variable is changed, accordingly to the formula used into the !SetVariable bangs of the KeyUpAction option, but none of these measures don't know this, because they are not updated. Their update occurs only on next update cycle and because the Update is set to 10,000, this might take up to 10 seconds. Depending on when the update happens, the next keypress can or can't have the appropriate and desired result.
Simple solution: add the needed !UpdateMeasure bangs to the KeyUpAction options of all HotKey plugin measures. Beside this, you can remove both the !UpdateMeter and the !Redraw bangs, because the meters are updated into the IfTrueAction options of the [MeasureAlpha] measure. Taking all this into account the mentioned options should have the following forms:

Code: Select all

[MeasureHotKeyUp]
...
KeyUpAction=[!SetVariable selected (Clamp(#selected#-2,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeasure "MeasureHotKeyUp"][!UpdateMeasure "MeasureHotKeyDown"][!UpdateMeasure "MeasureHotKeyRight"][!UpdateMeasure "MeasureHotKeyLeft"]
...

[MeasureHotKeyDown]
...
KeyUpAction=[!SetVariable selected (Clamp(#selected#+2,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeasure "MeasureHotKeyUp"][!UpdateMeasure "MeasureHotKeyDown"][!UpdateMeasure "MeasureHotKeyRight"][!UpdateMeasure "MeasureHotKeyLeft"]
...

[MeasureHotKeyRight]
...
KeyUpAction=[!SetVariable selected (Clamp(#selected#+1,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeasure "MeasureHotKeyUp"][!UpdateMeasure "MeasureHotKeyDown"][!UpdateMeasure "MeasureHotKeyRight"][!UpdateMeasure "MeasureHotKeyLeft"]
...

[MeasureHotKeyLeft]
...
KeyUpAction=[!SetVariable selected (Clamp(#selected#-1,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeasure "MeasureHotKeyUp"][!UpdateMeasure "MeasureHotKeyDown"][!UpdateMeasure "MeasureHotKeyRight"][!UpdateMeasure "MeasureHotKeyLeft"]
...
Now my opinion about the Update issue: in case of skins entirely controlled by mouse (or in your case by the remote control), I tend to set the Update to Update=-1, which prevents the skin from being updated. This might have a great impact on resources usage, but it might have has a great disadvantage if you don't pay enough attention to the details: on every change (keypress, clicks or even mouse movements, depending on the code) you have to update the appropriate measures and meters. An alternative solution might be to update the entire skin, through !Update bangs (if you do this don't use the !Redraw bang as well, because when an update occurs, a redraw is automatically made, so no need to redraw the skin with the !Redraw bang), but in this case the whole process loses it meaning because if you update the whole skin, instead of just the appropriate measures and meters, you didn't do too much.