I am looking to avoid ever typing in my email address again. Is there a way to configure a key to paste some pre-set bit of text like my email.
I'd like this to work across all applications ideally.
thanks
I am looking to avoid ever typing in my email address again. Is there a way to configure a key to paste some pre-set bit of text like my email.
I'd like this to work across all applications ideally.
thanks
sudo apt-get install xclip xdotool
mkdir ~/bin
gedit ~/bin/myscript.sh
#!/bin/bash
TEXT="myname@address.com"
printf '%s' "$TEXT" | xclip -i -selection clipboard
xdotool key --clearmodifiers "ctrl+v"
chmod +x ~/bin/myscript.sh
Settings -> Keyboard -> Shortcuts -> Custom shortcuts -> click [+]
Disabled text and then press your magical keystroke. For example Ctrl-Shift-Ssetsid unity or by logging in and out to make the shortcut work. (at least i had this bug on Ubuntu 13.10)If you have any problems with pasting the text. Try changing xdotool key to xdotool sleep 0.5 key. It gives you time to take your hands off the keyboard before xdotool tries to press "Ctrl-V"
The previous reply is from 2013 and we need something that works on 2021.
xdotool doesn't work on wayland.
xdotool does not always work as expected (i.e. it's sometimes very flaky).
An alternative tool to xdotool is ydotool.
sudo apt install -y ydotool xclip
Copy/paste is disabled on some applications and you may want to use this tool to type text instead of pasting.
Create a file ~/bin/myscript.sh
#!/bin/bash
xclip -o | ydotool type --delay 1000 --key-delay 70 --file -
This is easier.
Create a file ~/bin/myscript.sh
#!/bin/bash
TEXT="ad eundem rivum lupus et agnus venerant"
ydotool type --delay 1000 --key-delay 70 $TEXT
Settings -> Keyboard -> Shortcuts -> Custom shortcuts -> click [+]
Disabled text and then press your magical keystroke. For example Ctrl-Shift-STry espanso which is a pretty good system-wide text expander:
https://espanso.org/