Using a keyboard shortcut to paste text
There are lots of websites which only allow signing in with email address and password and I am tired of typing a long email address. I don't want my browser to remember my email. Can I assign a keyboard shortcut to print this email address so that every time I press the key I get my email address on current text field?
I am using Ubuntu 14.04 and I have very little knowledge about Ubuntu. I'm not talking about snippets. Just a defined text to paste when the key is pressed.
To paste a single string into a textfield
-
install both
xdotool
andxclip
:sudo apt-get install xdotool xclip
-
Add the following command to a shortcut key:
/bin/bash -c "sleep 0.5 && printf '[email protected]' | xclip -selection clipboard && xdotool key Control_L+v"
Choose: System Settings > "Keyboard" > "Shortcuts" > "Custom Shortcuts". Click the "+" and add the command above to a key combination of your choice.
Now when enter the cursor in a textfield and choose your shortcut, it will type your email address.