Skip to content

Commit 3dfae13

Browse files
committed
Plugins: System Commands: Re-add exit & settings command
1 parent 5e0b095 commit 3dfae13

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
<system:String x:Key="flowlauncher_plugin_sys_hibernate_cmd">Hibernate</system:String>
1818
<system:String x:Key="flowlauncher_plugin_sys_emptyrecyclebin_cmd">Empty Recycle Bin</system:String>
1919
<system:String x:Key="flowlauncher_plugin_sys_openrecyclebin_cmd">Open Recycle Bin</system:String>
20+
<system:String x:Key="flowlauncher_plugin_sys_exit_cmd">Exit</system:String>
21+
<system:String x:Key="flowlauncher_plugin_sys_setting_cmd">Settings</system:String>
2022
<system:String x:Key="flowlauncher_plugin_sys_toggle_game_mode_cmd">Toggle Game Mode</system:String>
2123

2224
<system:String x:Key="flowlauncher_plugin_sys_edit">Edit</system:String>
@@ -27,6 +29,8 @@
2729
<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>
2830
<system:String x:Key="flowlauncher_plugin_sys_log_off">Log off</system:String>
2931
<system:String x:Key="flowlauncher_plugin_sys_lock">Lock this computer</system:String>
32+
<system:String x:Key="flowlauncher_plugin_sys_exit">Close Flow Launcher</system:String>
33+
<system:String x:Key="flowlauncher_plugin_sys_setting">Tweak Flow Launcher's settings</system:String>
3034
<system:String x:Key="flowlauncher_plugin_sys_sleep">Put computer to sleep</system:String>
3135
<system:String x:Key="flowlauncher_plugin_sys_emptyrecyclebin">Empty recycle bin</system:String>
3236
<system:String x:Key="flowlauncher_plugin_sys_openrecyclebin">Open recycle bin</system:String>

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ public class Main : IPlugin, ISettingProvider, IPluginI18n
2626
{"Lock", "flowlauncher_plugin_sys_lock_cmd"},
2727
{"Sleep", "flowlauncher_plugin_sys_sleep_cmd"},
2828
{"Hibernate", "flowlauncher_plugin_sys_hibernate_cmd"},
29+
2930
{"Empty Recycle Bin", "flowlauncher_plugin_sys_emptyrecyclebin_cmd"},
3031
{"Open Recycle Bin", "flowlauncher_plugin_sys_openrecyclebin_cmd"},
32+
{"Settings", "flowlauncher_plugin_sys_setting_cmd"},
33+
{"Exit", "flowlauncher_plugin_sys_exit_cmd"},
3134
{"Toggle Game Mode", "flowlauncher_plugin_sys_toggle_game_mode_cmd"},
3235
};
3336
private readonly Dictionary<string, string> KeywordDescriptionMappings = new();
@@ -319,6 +322,29 @@ private List<Result> Commands(Query query)
319322
}
320323
},
321324
new Result
325+
{
326+
Title = "Exit",
327+
IcoPath = "Images\\app.png",
328+
Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xe89f"),
329+
Action = c =>
330+
{
331+
_context.API.HideMainWindow();
332+
Application.Current.MainWindow.Close();
333+
return true;
334+
}
335+
},
336+
new Result
337+
{
338+
Title = "Settings",
339+
Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xf210"),
340+
IcoPath = "Images\\app.png",
341+
Action = c =>
342+
{
343+
_context.API.OpenSettingDialog();
344+
return true;
345+
}
346+
},
347+
new Result
322348
{
323349
Title = "Toggle Game Mode",
324350
Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\ue7fc"),

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ public Settings()
6161
Keyword = "Open Recycle Bin"
6262
},
6363
new()
64+
{
65+
Key = "Exit",
66+
Keyword = "Exit"
67+
},
68+
new()
69+
{
70+
Key = "Settings",
71+
Keyword = "Settings"
72+
},
73+
new()
6474
{
6575
Key = "Toggle Game Mode",
6676
Keyword = "Toggle Game Mode"

0 commit comments

Comments
 (0)