简体   繁体   中英

Sending a paste command to a specific X11 window

I'm launching multiple instances of a game via bash. Each instance has it's own login password, which I can retrieve from my password manager, which will place it in the clipboard. I'd like to send each instance it's corresponding password and an "Enter" key event, to log them in automatically. The game runs inside a wine virtual desktop, and each instance has a unique window title in WM_NAME.

Any way I can automate the login process?

try xte & wmctrl packages... Using wmctrl, you can focus any specific window & using xte, you can fake keystrokes.

  1. Based on title, you can focus any window, using wmctrl.
  2. They add some time delay, if required
  3. Send keystrokes using xte

Check the man-pages for syntax.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM