So I'm currently working on a program that allows the use of links to either open a program or bring up its screen (using "windowskey+key1" to bring it up from the taskbar) so I am able to remove my taskbar completely for my desktop to look right.
I've tried to do this by creating a plugin measure to detect whether a program is running, and a bang to either run the program (currently chrome.exe) or use NirCmd's "sendkeypress" command to send lwin+1 and toggle open the program.
Both commands I have written work independently fine when placed after LeftMouseUpAction, and when the NirCmd command is replaced with a different program (such as notepad.exe), the whole program also works.
The problem is where the SetToggle bang is activated. Although it is set to change Command to the same bang that worked previously (Toggle), it will not work when clicked, and will instead run the Open command that it should have been changed from.
I've also tried replacing the !SetVariable bangs to !SetOption, and to make them change the LeftMouseUpAction directly, but that didn't work.
Here is my code, I would appreciate any help or advice I can get for this.
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
BackgroundMode=2
SolidColor=0,0,0,1
[Variables]
;Two link options
Open=["Chrome.exe"]
Toggle=["C:\Program Files\NirCmd\NirCmd.exe" sendkeypress lwin+1]
SetOpen=[!SetVariable Command #Open#]
SetToggle=[!SetVariable Command #Toggle#]
;Command set to "open" on computer startup
Command=#Open#
[MeasureProcess]
Measure=Plugin
Plugin=Process
ProcessName=Chrome.exe
;Chrome not open
IfBelowValue=0
IfBelowAction=#SetOpen#
;Chrome open
IfAboveValue=0
IfAboveAction=#SetToggle#
[ChromeMeter]
;Currently text to show whether program is open for error testing
Meter=String
Text=[MeasureProcess]
AntiAlias=1
FontColor=255,255,255,255
FontFace=Dudu Calligraphy
FontSize=30
LeftMouseUpAction=#Command#
DynamicVariables=1