mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
add HelloWorldFSharp example plugin
This commit is contained in:
parent
032a203224
commit
1238d86fc5
4 changed files with 86 additions and 0 deletions
|
|
@ -74,6 +74,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Browse
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Calculator", "Plugins\Flow.Launcher.Plugin.Calculator\Flow.Launcher.Plugin.Calculator.csproj", "{59BD9891-3837-438A-958D-ADC7F91F6F7E}"
|
||||
EndProject
|
||||
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "HelloWorldFSharp", "Plugins\HelloWorldFSharp\HelloWorldFSharp.fsproj", "{30DDA7D9-3712-44F4-BD18-DC1C05B2DD9E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
|
@ -313,6 +315,18 @@ Global
|
|||
{59BD9891-3837-438A-958D-ADC7F91F6F7E}.Release|x64.Build.0 = Release|Any CPU
|
||||
{59BD9891-3837-438A-958D-ADC7F91F6F7E}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{59BD9891-3837-438A-958D-ADC7F91F6F7E}.Release|x86.Build.0 = Release|Any CPU
|
||||
{30DDA7D9-3712-44F4-BD18-DC1C05B2DD9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{30DDA7D9-3712-44F4-BD18-DC1C05B2DD9E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{30DDA7D9-3712-44F4-BD18-DC1C05B2DD9E}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{30DDA7D9-3712-44F4-BD18-DC1C05B2DD9E}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{30DDA7D9-3712-44F4-BD18-DC1C05B2DD9E}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{30DDA7D9-3712-44F4-BD18-DC1C05B2DD9E}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{30DDA7D9-3712-44F4-BD18-DC1C05B2DD9E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{30DDA7D9-3712-44F4-BD18-DC1C05B2DD9E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{30DDA7D9-3712-44F4-BD18-DC1C05B2DD9E}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{30DDA7D9-3712-44F4-BD18-DC1C05B2DD9E}.Release|x64.Build.0 = Release|Any CPU
|
||||
{30DDA7D9-3712-44F4-BD18-DC1C05B2DD9E}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{30DDA7D9-3712-44F4-BD18-DC1C05B2DD9E}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
@ -332,6 +346,7 @@ Global
|
|||
{C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
|
||||
{9B130CC5-14FB-41FF-B310-0A95B6894C37} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
|
||||
{59BD9891-3837-438A-958D-ADC7F91F6F7E} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
|
||||
{30DDA7D9-3712-44F4-BD18-DC1C05B2DD9E} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {F26ACB50-3F6C-4907-B0C9-1ADACC1D0DED}
|
||||
|
|
|
|||
29
Plugins/HelloWorldFSharp/HelloWorldFSharp.fsproj
Normal file
29
Plugins/HelloWorldFSharp/HelloWorldFSharp.fsproj
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<OutputPath>..\..\Output\Debug\Plugins\HelloWorldFSharp\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<OutputPath>..\..\Output\Release\Plugins\HelloWorldFSharp\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="plugin.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Compile Include="Main.fs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Flow.Launcher.Plugin\Flow.Launcher.Plugin.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
31
Plugins/HelloWorldFSharp/Main.fs
Normal file
31
Plugins/HelloWorldFSharp/Main.fs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
namespace HelloWorldFSharp
|
||||
|
||||
open Flow.Launcher.Plugin
|
||||
open System.Collections.Generic
|
||||
|
||||
type HelloWorldFSharpPlugin() =
|
||||
|
||||
let mutable initContext = PluginInitContext()
|
||||
|
||||
interface IPlugin with
|
||||
member this.Init (context: PluginInitContext) =
|
||||
initContext <- context
|
||||
|
||||
member this.Query (query: Query) =
|
||||
List<Result> [
|
||||
Result (Title = "Hello World from F#",
|
||||
SubTitle = sprintf "Query: %s" query.Search)
|
||||
|
||||
Result (Title = "Browse source code of this plugin",
|
||||
SubTitle = "click to open in browser",
|
||||
Action = (fun ctx ->
|
||||
initContext.CurrentPluginMetadata.Website
|
||||
|> System.Diagnostics.Process.Start
|
||||
|> ignore
|
||||
true))
|
||||
|
||||
Result (Title = "Trigger a tray message",
|
||||
Action = (fun _ ->
|
||||
initContext.API.ShowMsg ("Sample tray message", "from the F# plugin")
|
||||
false))
|
||||
]
|
||||
11
Plugins/HelloWorldFSharp/plugin.json
Normal file
11
Plugins/HelloWorldFSharp/plugin.json
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"ID":"8FF5D5C1F8194958A12E8668FB7ECC04",
|
||||
"ActionKeyword":"hf",
|
||||
"Name":"Hello World FSharp",
|
||||
"Description":"Hello World FSharp",
|
||||
"Author":"Ioannis G.",
|
||||
"Version":"1.0.0",
|
||||
"Language":"fsharp",
|
||||
"Website":"https://github.com/Flow-Launcher/Flow.Launcher",
|
||||
"ExecuteFileName":"HelloWorldFSharp.dll"
|
||||
}
|
||||
Loading…
Reference in a new issue