Skip to content

Commit be516d6

Browse files
committed
add Advanced Boot Options restart for Sys plugin
1 parent df9cb4b commit be516d6

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed
57.3 KB
Loading

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
<system:String x:Key="flowlauncher_plugin_sys_shutdown_computer">Shutdown Computer</system:String>
1010
<system:String x:Key="flowlauncher_plugin_sys_restart_computer">Restart Computer</system:String>
11+
<system:String x:Key="flowlauncher_plugin_sys_restart_advanced">Restart the computer with Advanced Boot Options for Safe and Debugging modes, as well as other options</system:String>
1112
<system:String x:Key="flowlauncher_plugin_sys_log_off">Log off</system:String>
1213
<system:String x:Key="flowlauncher_plugin_sys_lock">Lock this computer</system:String>
1314
<system:String x:Key="flowlauncher_plugin_sys_exit">Close Flow Launcher</system:String>
@@ -29,6 +30,7 @@
2930
<system:String x:Key="flowlauncher_plugin_sys_dlgtext_all_applicableplugins_reloaded">Reloaded all applicable plugin data</system:String>
3031
<system:String x:Key="flowlauncher_plugin_sys_dlgtext_shutdown_computer">Are you sure you want to shut the computer down?</system:String>
3132
<system:String x:Key="flowlauncher_plugin_sys_dlgtext_restart_computer">Are you sure you want to restart the computer?</system:String>
33+
<system:String x:Key="flowlauncher_plugin_sys_dlgtext_restart_computer_advanced">Are you sure you want to restart the computer with Advanced Boot Options?</system:String>
3234

3335
<system:String x:Key="flowlauncher_plugin_sys_plugin_name">System Commands</system:String>
3436
<system:String x:Key="flowlauncher_plugin_sys_plugin_description">Provides System related commands. e.g. shutdown, lock, settings etc.</system:String>

Plugins/Flow.Launcher.Plugin.Sys/Main.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,24 @@ private List<Result> Commands()
131131
}
132132
},
133133
new Result
134+
{
135+
Title = "Restart With Advanced Boot Options",
136+
SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_restart_advanced"),
137+
IcoPath = "Images\\restart_advanced.png",
138+
Action = c =>
139+
{
140+
var result = MessageBox.Show(
141+
context.API.GetTranslation("flowlauncher_plugin_sys_dlgtext_restart_computer_advanced"),
142+
context.API.GetTranslation("flowlauncher_plugin_sys_restart_computer"),
143+
MessageBoxButton.YesNo, MessageBoxImage.Warning);
144+
145+
if (result == MessageBoxResult.Yes)
146+
Process.Start("shutdown", "/r /o /t 0");
147+
148+
return true;
149+
}
150+
},
151+
new Result
134152
{
135153
Title = "Log Off",
136154
SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_log_off"),

Plugins/Flow.Launcher.Plugin.Sys/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"Name": "System Commands",
55
"Description": "Provide System related commands. e.g. shutdown,lock, setting etc.",
66
"Author": "qianlifeng",
7-
"Version": "1.3.2",
7+
"Version": "1.4.0",
88
"Language": "csharp",
99
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
1010
"ExecuteFileName": "Flow.Launcher.Plugin.Sys.dll",

0 commit comments

Comments
 (0)