Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Ubuntu 9.10 is out!!!

When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu.

The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely.

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old November 14th, 2006   #1
grizzly
A Carafe of Ubuntu
 
Join Date: Oct 2005
Location: India
Beans: 113
Kubuntu 6.06
HOWTO keyboard macros macro in linux

Yup, its indeed possible to have system-wide application independent macros in unix! thanks to xmacros and whoever who wrote a guide somehere i don't remember.

Step 1. Install the app
Quote:
aptitude install xmacro
Step 2. Record the macro:
Quote:
xmacrorec -d 1400 > ~/quote
wait...
Step 3. xmacro isn't perfect so open ~/quote for editing, as many lines are repeated and need to be removed.
Step 4. Replay the macro
Quote:
cat ~/quote | xmacroplay ":0.0"
Basically xmacroplay plays the commands from a text file.The text file can be written manually or by the above recording method. Reading the examplbelow should make it all very easy.
EXAMPLE
Quote:
Delay 1 # Always add this!!
KeyStrPress bracketleft
KeyStrRelease bracketleft
String quote
KeyStrPress bracketright
KeyStrRelease bracketright
KeyStrPress bracketleft
KeyStrRelease bracketleft
KeyStrPress slash
KeyStrRelease slash
String quote
KeyStrPress bracketright
KeyStrRelease bracketright
Delay 1 #delay
KeyStrRelease Left
KeyStrPress Left
KeyStrRelease Left
KeyStrPress Left
KeyStrRelease Left
KeyStrPress Left
KeyStrRelease Left
KeyStrPress Left
KeyStrRelease Left
KeyStrPress Left
KeyStrRelease Left
KeyStrPress Left
KeyStrRelease Left
KeyStrPress Left
KeyStrRelease Left
KeyStrPress Lef
The above types [ q u o t e ] [ / q u o t e ] followed by 8 'left arrow' keys so that the cursor is between [qote] & [/quote] priceless..

Example 2
Delay 1 #delay
Sending a hotkey - Ctrl + g
Quote:
KeyStrPress Control_R
KeyStrPress g KeyStrRelease g
KeyStrRelease Control_R
=== Problems?
1. Read the last 4 topics on http://xmacro.sourceforge.net/ for a better understanfing of the macro file. its simple btw
2. try adding a lil delay (look in above example for how)
3. How to play the macro?? You can use xbindkeys/khotkeys(kdeonly) to assign a shortcut for the macro.
__________________
End the hassle of typing ls!!
Get a list of files/folders of the current directory of the shell you are running !!
VIEWGLOB! - SCREENSHOT
-- works with bash and zsh

Last edited by grizzly; November 17th, 2006 at 06:42 PM..
grizzly is offline   Reply With Quote
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:45 PM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry