4

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".

Timo
  • 6,202
  • 1
  • 26
  • 28
xralf
  • 16,149
  • 29
  • 101
  • 149

1 Answers1

2

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
Peter.O
  • 32,426
  • 28
  • 115
  • 163
  • I have a problem running Autokey in XFCE and Autokey does not support unicode (see [here](http://askubuntu.com/questions/23305/is-there-any-way-of-adding-chinese-characters-to-autokey)) – 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 01 '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 02 '11 at 05: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 02 '11 at 06:41
  • This is sufficent. I don't need recognizing abbreviation in Unicode. – xralf May 02 '11 at 07:06