mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
31 lines
1.2 KiB
FSharp
31 lines
1.2 KiB
FSharp
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))
|
|
]
|