mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #377 from Flow-Launcher/fix_hibernation
Fix hibernation
This commit is contained in:
commit
5e011db37b
3 changed files with 13 additions and 3 deletions
BIN
Plugins/Flow.Launcher.Plugin.Sys/Images/hibernate.png
Normal file
BIN
Plugins/Flow.Launcher.Plugin.Sys/Images/hibernate.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 71 KiB |
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue