Gexpansion Homepage

Program information: Gnome text expansion utility aka autotext for gnome.

Download gexpansion here. gexpansion.tar

Support This Project

SourceForge.net Logo

Gexpansion is a utility for running linux commands when keyboard triggers are detected. it is mostly used for text expansion, for egample you type your initials and it can type your whole name. it is made to make repetitive typeing a little less repetative.

Author: Kristian Rekovic : email:kristian.rekovic@gmail.com

gexpansion - gnome text expansion utility written by Kristian Rekovic. Copyright (C) 2008 Kristian Rekovic This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses

Please follow these steps to get everething up and running :)

1) enable keyboard acessability in ubuntu. - go to System - Preferences - Assistive Technologies - "check off" enable assitive technologies.

2) Install xautomation for keyboard emulation. - open up a terminal and type - sudo apt-get -y install xautomation.

3) Extract the gexpansion (somewere in your home folder) you can rename the folder it doesn't matter

4) Go to the folder and set read and write permissions for your current user on the key.log file

5) Restart gnome desktop log in / log out to enable the first step we did.

6) Open up gnome-terminal - Press left_alt and f2 , type gnome-terminal - cd into the directory where you extracted g expansion, to emphasise things please make sure key.log is writable. - ok so let's get to it, type: python gexpansion.py press enter. - leave the terminal open. - run gedit to test this out. hit the spacebar once and type .hello and spacebar again. this should trigger a macro (text expansion). - if the .hello trigger printed hello world then you are on your way.

7) Customizing macros and commands - the macros are stored in macros.cfg - here are two examples on how macros work.

.hello=xte 'str Hello World'

Breakdown of the macro: .hello - trigger word, when this is detected as being typed anywere in gnome it prints Hello World. - you have to be carefull with this as u can use any word as a trigger - the . is just a preference you can go /hello or hello for a trigger word you don't need the . - the = is the seperator anything before = is the trigger word, anithing after is a linux command to be run.

xte --- xautomation - I use xte to simulate keyboard presses. - the command xte 'str Hello World' your curser is located in a document.

- The second example below is the same exept i am executing espeak to read the phrase My email address triggered, then it run's the command xte with a string value.

- Two things i can't really emphasize on this more

1) Please do not leave any blank lines in the document as this will mess up the parser from reading macros. 2) This program can run any program you can run from bash , so everething :)

.mail=espeak "My email address triggered." & xte 'str myemail@mydomain.com'