I want to use keyboard combination Alt-E to write my email address, rather than have to type it out all the time.
I know how to create a custom key in
unity-control-center
- Keyboard
- Shortcuts
- Custom Shortcuts
...but I can't figure out what to write in the Command: field. I've tried:
echo "[email protected]"
and
cat "[email protected]"
and
sed "[email protected]"
... but as you can tell, I don't know what I'm doing. I've just been trying things from a websearch "linux custom key output specified text".
It doesn't seem as if a macro would be necessary, nor the installation of another application. I've found a couple of other solutions here that both involve installing another application (autokey
, xdotool
). It seems to me that there would be a command on Linux that I would be able to use in the Command: field. Could that be true?
I'm not sure if you can run a command almost essentially in a terminal and have it auto-type to any application window that happens to be open & selected.
Autokey does, and works great and is very simple to just type some keys, essentially just use
and set a hotkey and you're done.
Simplest solution
"It seems to me that there would be a command on Linux that I would be able to use in the Command: field. Could that be true?" No, not without installing anything additionally, but
..Make xdotool type it for you.
You have several options and tools, but the easiest / simplest solution is to add the following command to a shortcut:
The
sleep 0.2
is to prevent your actual keypress (shortcut) to interfere with the virtual keypress by xdotool.Note
Depending on what else you have installed, you might need to install
xdotool
: