Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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

Could you show me how to write macro in xmacro (that will work in whole desktop environment) that is able to expand strings?

E.g. I will type "thx" and it will expand to "thank you".

share|improve this question
up vote 2 down vote accepted

xmacro is a basic macro-recorder/macro-player.. it is good for some things, but is not suited to monitoring your keystrokes dynamically (other than for recording)...

  • xmacro: Record / Play keystrokes and mouse movements in X displays

You are probably better off using a tool like autokey.. You can find some tutorials at How-To Geek

Autokey Sample Scripts
Autokey Video
Autokey Features:

  • KDE and GTK versions available, making AutoKey integrate well into any desktop environment.
  • Write Python scripts to automate virtually any task that can be accomplished via the keyboard
  • Built-in code editor (using QScintilla in KDE or GtkSourceView2 in GTK)
  • Create phrases (blocks of text) to be pasted into any program on demand (uses the X selection)
  • Create collections of phrases/scripts in folders, and assign a hotkey or abbreviation to the folder to display a popup menu
  • Regular expressions can be used to filter windows by their title, to exclude hotkeys/abbreviations from triggering in certain applications
  • Scripts, phrases and folders can be attached to the tray icon menu, allowing you to select them without assigning a hotkey or abbreviation
  • AutoKey can track your usage patterns and present the most frequently used items at the top of the popup menu
share|improve this answer
I have a problem running Autokey in XFCE and Autokey does not support unicode (see here) – xralf Apr 30 '11 at 14:15
Aha.. you've just remeinded me why I didn't use Autokey... I tried it six months ago, and I'd forgotten about that... Your question revived my interest in it, but now I'll have to shelve that idea again... Any program which can't handle Unicode is a useless relic... but I suppose it is still good for ASCII.. and other macro things, like manipulating windows... (but I want unicode... – Peter.O May 1 '11 at 22:41
It seems there isn't alternative for Autokey which can handle unicode? But I haven't tried Autokey yet, because of the problem in another question. – xralf May 2 '11 at 5:40
btw.. Autokey can insert unicode text which is triggered by an ASCII abbreviation (I tried it today; it worked for inserting Unicode text); eg. brn will automatically be replaced by be right ñññ (or whatever you choose), but it won't recognize an abbreviation in Unicode, ie. it won't recognize brñ as an abbreviaton... I believe there are some hackish workarounds.. but I haven't fully looked into it.. I read that the hacks allow the use of Unicode in the scripts. – Peter.O May 2 '11 at 6:41
This is sufficent. I don't need recognizing abbreviation in Unicode. – xralf May 2 '11 at 7:06

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.