25 lines
553 B
C#
25 lines
553 B
C#
using System.Diagnostics;
|
|
|
|
namespace Hush.Input;
|
|
|
|
public class XdotoolInput : ITextInput
|
|
{
|
|
public async Task TypeString(string text)
|
|
{
|
|
var process = new Process
|
|
{
|
|
StartInfo = new ProcessStartInfo
|
|
{
|
|
FileName = "xdotool",
|
|
Arguments = $"type --delay 10 -- \"{text}\"",
|
|
UseShellExecute = false,
|
|
CreateNoWindow = true
|
|
}
|
|
};
|
|
|
|
process.Start();
|
|
await process.WaitForExitAsync();
|
|
process.Dispose();
|
|
}
|
|
}
|