Merge pull request #377 from Flow-Launcher/fix_hibernation

Fix hibernation
This commit is contained in:
Jeremy Wu 2021-03-05 18:54:41 +11:00 committed by GitHub
commit 5e011db37b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View file

@ -6,6 +6,7 @@ using System.Windows;
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 @@ namespace Flow.Launcher.Plugin.Sys
{
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
{

View file

@ -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",