It is currently October 9th, 2024, 3:15 am

RunCommand

Share and get help with Plugins and Addons
User avatar
Yincognito
Rainmeter Sage
Posts: 8390
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: RunCommand 1.1

Post by Yincognito »

jsmorley wrote:We simply MUST fix this "version" issue with 3rd-party plugins.
...while having minimal "casualties" during the process, I might add :)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: RunCommand

Post by kyriakos876 »

Hello, I'm trying to understand how this plugin works. I would like to have a meter that, when clicked, will either "Open" a program or "Show" it if it is already running minimized. It should be something like this:

Code: Select all

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter="something" "Vivaldi.exe"
State=Show/Run
But I don't know what to set in the "Parameter" and in the "State" sections.

Code: Select all

[Measure_That_Decides_What_Meter_Is_Displayed]
Measure=Calc
IfCondition=[*IsRunning*]
IfTrueAction=[*Show*]
IfCondition2=[*IsNotRunning*]
IfTrueAction2=[*Run*]

[Meter_That_Executes_The_Measure]
Meter=Image
SolidColor=0,0,0,255
W=40
H=40
LeftMouseUpAction=[!CommandMeasure Measure_That_Decides_What_Meter_Is_Displayed "Run"]
(This is the idea of how the code operates, Obviously using the Measure with the RunCommand plugin somehow.)

In the Measure Above I also don't know what to set in the condition sections.
If somebody could help me with this one I would appreciate it.

-Thanks in advance.
User avatar
jsmorley
Developer
Posts: 22843
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RunCommand

Post by jsmorley »

I don't think there is a graceful way to do this. When a shell command to a program is executed, it is up to the program, if it is already running, whether that causes a minimized instance of the program to be restored, or an entirely new instance to be executed, or even ignored entirely if multiple instances are not supported. That is not something you are going to have any control over in most cases.

Detecting the state of an applications window is something you can do...

https://forum.rainmeter.net/viewtopic.php?p=115480#p115480

But what you can do with that information is problematic. You almost never have any control over what a running application will do when its command line is executed.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: RunCommand

Post by kyriakos876 »

jsmorley wrote:I don't think there is a graceful way to do this. When a shell command to a program is executed, it is up to the program, if it is already running, whether that causes a minimized instance of the program to be restored, or an entirely new instance to be executed, or even ignored entirely if multiple instances are not supported. That is not something you are going to have any control over in most cases.
Is there any other plugin that works like the windows taskbar, that will maximize/minimize a program when it is minimized/maximized respectively or run it if not running at all?
User avatar
jsmorley
Developer
Posts: 22843
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RunCommand

Post by jsmorley »

kyriakos876 wrote:Is there any other plugin that works like the windows taskbar, that will maximize/minimize a program when it is minimized/maximized respectively or run it if not running at all?
Not that I know of.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: RunCommand

Post by kyriakos876 »

jsmorley wrote:Not that I know of.
I see... I'll try work something out with the skin you provided.

Thanks anyway!
User avatar
jsmorley
Developer
Posts: 22843
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RunCommand

Post by jsmorley »

kyriakos876 wrote:I see... I'll try work something out with the skin you provided.

Thanks anyway!
Sure thing. To be honest, we have little interest in trying to replicate Windows operating system functionality. It is not the intention of Rainmeter to be an application development tool, and you will find little support from us for trying to recreate the taskbar, notification area, file explorer or other core Windows components. You want to restore that program you are running? That is what the Windows Taskbar is for... Rainmeter is not a shell replacement, trying to use Rainmeter to isolate yourself from the user interface of Windows is both doomed to failure, and not something we are likely to address.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: RunCommand

Post by kyriakos876 »

jsmorley wrote:To be honest, we have little interest in trying to replicate Windows operating system functionality
I've noticed that, yet I'm just trying to simplify the use of my pc even more... Sounds stupid as it is always pretty simple to click an icon on the bottom of your screen but you know... there's always "simpler". Discovering the way and being unable to make it happen though, is what bugs me :D
User avatar
jsmorley
Developer
Posts: 22843
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RunCommand

Post by jsmorley »

Our reluctance is not based on some principle, other than the fact that we always want to do something "right" or not at all. There is just no practical way, other than a Manhattan Project level of work and tons and tons of code, that we could ever even get close to approximating the level of functionality in the Windows Taskbar (for instance). I personally have no interest in built-in or plugin functionality in Rainmeter that just gives you a crippled, amateurish version of something that Windows has spent 20 years getting right.
User avatar
tjhrulz
Developer
Posts: 268
Joined: October 13th, 2016, 1:28 am
Location: Earth

Re: RunCommand

Post by tjhrulz »

kyriakos876 wrote:Is there any other plugin that works like the windows taskbar, that will maximize/minimize a program when it is minimized/maximized respectively or run it if not running at all?
I am not 100% certain but I think Azack's ProgramOptions plugin may have some of the features your are looking for, if it does not I will pass it along to him to include in his upcoming stuff he is working on.