mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
add initial ShellRun support for JsonRPC
This commit is contained in:
parent
3baaa2d406
commit
d41dd780ce
2 changed files with 16 additions and 0 deletions
|
|
@ -29,6 +29,12 @@ namespace Flow.Launcher.Plugin
|
|||
/// </summary>
|
||||
void RestartApp();
|
||||
|
||||
/// <summary>
|
||||
/// Run a shell command or external program
|
||||
/// </summary>
|
||||
/// <param name="cmd">The command or program to run</param>
|
||||
void ShellRun(string cmd);
|
||||
|
||||
/// <summary>
|
||||
/// Save everything, all of Flow Launcher and plugins' data and settings
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -103,6 +103,16 @@ namespace Flow.Launcher
|
|||
});
|
||||
}
|
||||
|
||||
public void ShellRun(string cmd)
|
||||
{
|
||||
System.Diagnostics.Process process = new();
|
||||
var startInfo = process.StartInfo;
|
||||
startInfo.FileName = "cmd.exe";
|
||||
startInfo.Arguments = $"/C {cmd}";
|
||||
startInfo.CreateNoWindow = true;
|
||||
process.Start();
|
||||
}
|
||||
|
||||
public void StartLoadingBar() => _mainVM.ProgressBarVisibility = Visibility.Visible;
|
||||
|
||||
public void StopLoadingBar() => _mainVM.ProgressBarVisibility = Visibility.Collapsed;
|
||||
|
|
|
|||
Loading…
Reference in a new issue