Take the 2-minute tour ×
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.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.