Ubuntu: Copy-paste password “macro-style”?


I've run into some programs that don't let me copy-paste text into them. This is a problem, as I use a password manager (KeePass), and not being able to copy-paste my password into the login screen (as is the case with Minecraft) is a problem.

I could bypass this by using shorter passwords that are easy to type, but I'd rather ask you fine people if you know any software that "pastes" text by, say, issuing the key presses as a macro command. For example, pasting "agiK" would execute a-g-i-holdshift-k-releaseshift as key presses.

Anyone know of such software?


In any way, never copy-paste a password from a plain-text source.

The script below can be used to paste your password in an entry of a Zenity dialog. Subsequently, after pressing OK, the script will type out what is entered (or pasted) after three seconds.

Although I wouldn't see how, I am not sure if there are any security issues with what you want, so use it at your own risk.

enter image description here

The script

#!/usr/bin/env python3  import subprocess  import time  try:      password = subprocess.check_output([          "zenity", "--entry", "--title=Password",          "--text=Paste your password below"]).decode("utf-8")      time.sleep(3)      for c in password:          subprocess.call(["xdotool", "type", c])  except subprocess.CalledProcessError:      pass  

How to use

  1. The script needs xdotool:

    sudo apt-get install xdotool  
  2. Copy the script into an emty file, save it as pasteword.py

  3. Test-run it by the command:

    python3 /path/to/pasteword.py  

    within three seconds, click in the entry where you have to enter the password, it will be typed out by xdotool

  4. If all works fine, add it to a shortcut: choose: System Settings > "Keyboard" > "Shortcuts" > "Custom Shortcuts". Click the "+" and add the command:

    python3 /path/to/pasteword.py  


If you find the three seconds not the most convenient value, you can change it in the line:


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »