@@ -85,9 +85,13 @@ func (y *ydotoolBackend) Inject(ctx context.Context, text string, timeout time.D
|
||||
if err := y.Available(); err != nil {
|
||||
return err
|
||||
}
|
||||
socketPath := y.getSocketPath()
|
||||
|
||||
// ydotool type -- "text"
|
||||
cmd := exec.CommandContext(ctx, "ydotool", "type", "--", text)
|
||||
if socketPath != "" {
|
||||
cmd.Env = append(os.Environ(), "YDOTOOL_SOCKET="+socketPath)
|
||||
}
|
||||
if err := cmd.Run(); err != nil {
|
||||
return fmt.Errorf("ydotool failed: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user