diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Images/hibernate.png b/Plugins/Flow.Launcher.Plugin.Sys/Images/hibernate.png new file mode 100644 index 00000000000..703204fa742 Binary files /dev/null and b/Plugins/Flow.Launcher.Plugin.Sys/Images/hibernate.png differ diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs index 0aa37cdf583..ca971b3f960 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs @@ -6,6 +6,7 @@ using System.Windows.Forms; using System.Windows.Interop; using Flow.Launcher.Infrastructure; +using Flow.Launcher.Plugin.SharedCommands; using Application = System.Windows.Application; using Control = System.Windows.Controls.Control; using FormsApplication = System.Windows.Forms.Application; @@ -156,8 +157,17 @@ private List Commands() { Title = "Hibernate", SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_hibernate"), - IcoPath = "Images\\sleep.png", // Icon change needed - Action = c => FormsApplication.SetSuspendState(PowerState.Hibernate, false, false) + IcoPath = "Images\\hibernate.png", + Action= c => + { + var info = ShellCommand.SetProcessStartInfo("shutdown", arguments:"/h"); + info.WindowStyle = ProcessWindowStyle.Hidden; + info.UseShellExecute = true; + + Process.Start(info); + + return true; + } }, new Result { diff --git a/Plugins/Flow.Launcher.Plugin.Sys/plugin.json b/Plugins/Flow.Launcher.Plugin.Sys/plugin.json index 75d7073b8bd..5c66b73dd42 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.Sys/plugin.json @@ -4,7 +4,7 @@ "Name": "System Commands", "Description": "Provide System related commands. e.g. shutdown,lock,setting etc.", "Author": "qianlifeng", - "Version": "1.2.0", + "Version": "1.2.1", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.Sys.dll",