Skip to content

Commit ead4c9a

Browse files
committed
Add more customized args
1 parent d5d263b commit ead4c9a

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<system:String x:Key="flowlauncher_plugin_program_customizedexplorer">Customized Explorer</system:String>
4545
<system:String x:Key="flowlauncher_plugin_program_args">Args</system:String>
4646
<system:String x:Key="flowlauncher_plugin_program_tooltip_customizedexplorer">You can customized the explorer used for opening the container folder by inputing the Environmental Variable of the explorer you want to use. It will be useful to use CMD to test whether the Environmental Variable is avaliable.</system:String>
47-
<system:String x:Key="flowlauncher_plugin_program_tooltip_args">Enter the customized args you want to add for your customized explorer. Check the explorer's website for details on additional args.</system:String>
47+
<system:String x:Key="flowlauncher_plugin_program_tooltip_args">Enter the customized args you want to add for your customized explorer. %s for parent directory, %f for full path (which only works for win32). Check the explorer's website for details.</system:String>
4848

4949
<!--Dialogs-->
5050
<system:String x:Key="flowlauncher_plugin_program_disable_dlgtitle_success">Success</system:String>

Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,9 @@ public List<Result> ContextMenus(IPublicAPI api)
141141
Action = _ =>
142142
{
143143
Main.StartProcess(Process.Start, new ProcessStartInfo(
144-
!string.IsNullOrEmpty(Main._settings.CustomizedExplorer) ? Main._settings.CustomizedExplorer:Settings.Explorer,
145-
$"{Main._settings.CustomizedArgs} \"{ParentDirectory}\"".Trim()));
144+
!string.IsNullOrWhiteSpace(Main._settings.CustomizedExplorer) ? Main._settings.CustomizedExplorer:Settings.Explorer,
145+
!string.IsNullOrWhiteSpace(Main._settings.CustomizedArgs)?Main._settings.CustomizedArgs.Replace("%s",$"\"{ParentDirectory}\"").Replace("%f",$"\"{FullPath}\""):
146+
Settings.ExplorerArgs));
146147
return true;
147148
},
148149
IcoPath = "Images/folder.png"

Plugins/Flow.Launcher.Plugin.Program/Settings.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ public class Settings
1515

1616
public bool EnableRegistrySource { get; set; } = true;
1717
public string CustomizedExplorer { get; set; } = Explorer;
18-
public string CustomizedArgs { get; set; }
18+
public string CustomizedArgs { get; set; } = ExplorerArgs;
1919

2020
internal const char SuffixSeperator = ';';
2121

2222
internal const string Explorer = "explorer";
2323

24+
internal const string ExplorerArgs = "/select,%f";
25+
2426
/// <summary>
2527
/// Contains user added folder location contents as well as all user disabled applications
2628
/// </summary>

0 commit comments

Comments
 (0)