Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I configure a shortcut key to send a text string to the current program?

The purpose is to type common entries quicker (email address, street address, phone number, username, favorite quote, etc).

I don't need any further automation than just entering the text.

Gentoo Linux (3.2.12-gentoo) Xfce Desktop Environment (Version 4.8)

share|improve this question
up vote 8 down vote accepted

One simple approach is xdotool, like

xdotool type 'text'
share|improve this answer
That's half the solution... how do I assign a keyboard shortcut to run that? Making a shortcut in Xfce 4.8 Settings, Keyboard didn't work. – Steven Apr 20 '12 at 2:24
@Steven Does it work directly from a terminal? – jw013 Apr 20 '12 at 2:31
Yes. Also, 'sleep 5 && xdotool type text' sends the text to the "active" window. – Steven Apr 20 '12 at 2:35
@Steven I haven't used Xfce in a while, but my next hunch is that when the command is run, the active window is wrong somehow. I'd try running xdotool getwindowfocus both from a terminal and as a keyboard shortcut while the same terminal is open and compare the results for equality. You'll probably have to redirect the keyboard shortcut version to a temporary file in order to see it. – jw013 Apr 20 '12 at 2:40
I use xbindkeys. – Mikel Apr 20 '12 at 2:47

You may use AutoKey. Here is the description from the web site. “AutoKey is a desktop automation utility for Linux and X11. It allows you to manage collection of scripts and phrases, and assign abbreviations and hotkeys to these. This allows you to execute a script or insert text on demand in whatever program you are using.”

It is packaged, as far as I can tell, for Gentoo (announced here); for Ubuntu (here); Debian (here)...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.