aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/GetWindows.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/GetWindows.cs b/src/GetWindows.cs
index 3eeb81c..e110760 100644
--- a/src/GetWindows.cs
+++ b/src/GetWindows.cs
@@ -4,7 +4,7 @@ namespace hyprwatch.Window
using System.Diagnostics;
using System.Text.RegularExpressions;
- public class GetWindows
+ public partial class GetWindows
{
public static string ActiveWindow()
{
@@ -28,7 +28,7 @@ namespace hyprwatch.Window
string output = process.StandardOutput.ReadToEnd();
process.WaitForExit();
- var classMatch = Regex.Match(output, @"class:(.+)");
+ var classMatch = ClassRegex().Match(output);
if(classMatch.Success)
{
@@ -47,5 +47,8 @@ namespace hyprwatch.Window
return activeWindow ?? string.Empty;
}
- }
+
+ [GeneratedRegex(@"class:(.+)")]
+ private static partial Regex ClassRegex();
+ }
}