Skip to content

Commit 3148287

Browse files
committed
csharpier
1 parent e9e8c3a commit 3148287

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

YMouseButtonControl.Linux/Services/CurrentWindowService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ namespace YMouseButtonControl.Linux.Services;
55
public class CurrentWindowService : ICurrentWindowService
66
{
77
public string ForegroundWindow => "*";
8-
}
8+
}

YMouseButtonControl.Linux/Services/CurrentWindowServiceX11.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ public class CurrentWindowServiceX11 : ICurrentWindowService
1010
private string GetForegroundWindow()
1111
{
1212
var startInfo = new ProcessStartInfo
13-
{ FileName = "/bin/bash", Arguments = "-c \"xdotool getwindowfocus getwindowpid\"", RedirectStandardOutput = true };
13+
{
14+
FileName = "/bin/bash",
15+
Arguments = "-c \"xdotool getwindowfocus getwindowpid\"",
16+
RedirectStandardOutput = true,
17+
};
1418
using var xdoProc = new Process();
1519
xdoProc.StartInfo = startInfo;
1620
xdoProc.Start();
@@ -21,14 +25,18 @@ private string GetForegroundWindow()
2125
{
2226
return "";
2327
}
24-
28+
2529
startInfo = new ProcessStartInfo
26-
{ FileName = "/bin/bash", Arguments = $"-c \"ls -l /proc/{pid}/exe\"", RedirectStandardOutput = true };
30+
{
31+
FileName = "/bin/bash",
32+
Arguments = $"-c \"ls -l /proc/{pid}/exe\"",
33+
RedirectStandardOutput = true,
34+
};
2735
using var proc = new Process();
2836
proc.StartInfo = startInfo;
2937
proc.Start();
3038
var path = proc.StandardOutput.ReadToEnd().Split("-> ")[1].Trim();
3139
proc.WaitForExit();
3240
return path;
3341
}
34-
}
42+
}

YMouseButtonControl/DependencyInjection/ServicesBootstrapper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private static void RegisterLinuxServices(IServiceCollection services)
6060
FileName = "/bin/bash",
6161
Arguments = "-c \"xdotool\"",
6262
RedirectStandardOutput = true,
63-
RedirectStandardError = true
63+
RedirectStandardError = true,
6464
};
6565
using var proc = new Process();
6666
proc.StartInfo = startInfo;
@@ -99,4 +99,4 @@ private static void RegisterMacOsServices(IServiceCollection services)
9999
.AddScoped<ICurrentWindowService, MacOS.Services.CurrentWindowService>()
100100
.AddScoped<IBackgroundTasksRunner, MacOS.Services.BackgroundTasksRunner>();
101101
}
102-
}
102+
}

0 commit comments

Comments
 (0)