Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add CopyText and AutoCompleteText to some results in the sys plugin #3114

Merged
merged 4 commits into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions Plugins/Flow.Launcher.Plugin.Sys/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ public void Init(PluginInitContext context)
private List<Result> Commands()
{
var results = new List<Result>();
var logPath = Path.Combine(DataLocation.DataDirectory(), "Logs", Constant.Version);
var userDataPath = DataLocation.DataDirectory();
var recycleBinFolder = "shell:RecycleBinFolder";
results.AddRange(new[]
{
new Result
Expand Down Expand Up @@ -294,10 +297,11 @@ private List<Result> Commands()
SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_openrecyclebin"),
IcoPath = "Images\\openrecyclebin.png",
Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xe74d"),
CopyText = recycleBinFolder,
Action = c =>
{
{
System.Diagnostics.Process.Start("explorer", "shell:RecycleBinFolder");
System.Diagnostics.Process.Start("explorer", recycleBinFolder);
}

return true;
Expand Down Expand Up @@ -386,9 +390,10 @@ private List<Result> Commands()
Title = "Open Log Location",
SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_open_log_location"),
IcoPath = "Images\\app.png",
CopyText = logPath,
AutoCompleteText = logPath,
Action = c =>
{
var logPath = Path.Combine(DataLocation.DataDirectory(), "Logs", Constant.Version);
context.API.OpenDirectory(logPath);
return true;
}
Expand All @@ -398,6 +403,8 @@ private List<Result> Commands()
Title = "Flow Launcher Tips",
SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_open_docs_tips"),
IcoPath = "Images\\app.png",
CopyText = Constant.Documentation,
AutoCompleteText = Constant.Documentation,
Action = c =>
{
context.API.OpenUrl(Constant.Documentation);
Expand All @@ -409,9 +416,11 @@ private List<Result> Commands()
Title = "Flow Launcher UserData Folder",
SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_open_userdata_location"),
IcoPath = "Images\\app.png",
CopyText = userDataPath,
AutoCompleteText = userDataPath,
Action = c =>
{
context.API.OpenDirectory(DataLocation.DataDirectory());
context.API.OpenDirectory(userDataPath);
return true;
}
},
Expand Down
Loading