You are not logged in.

#1 2008-02-05 10:30:41

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,893
Website

Text expansion in python

Hi,

I am going to try and create a Snippits like app in Python

The main problem I can see is finding text entered on screen [cursor postion!] not sure about using Xlib [got to read up more!]

So if you entered 'name' hit a key 'nm' would get cut and 'MrGreen' appear

Using Xbindkeys to connect key to start script [of course you can set it in *box etc...]

The search and replace is not too much of problem its the finding cursor and text ?

MrG


Mr Green

Offline

#2 2008-09-04 21:25:44

scooterpd
Member
Registered: 2008-09-01
Posts: 29

Re: Text expansion in python

are you still working on this?  i have been looking for something like this for the longest time.

Offline

#3 2008-09-05 05:40:16

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,893
Website

Re: Text expansion in python

I use a Firefox extension called text complete now does what I need, also works in Thunderbird too


Mr Green

Offline

#4 2008-09-05 17:04:41

scooterpd
Member
Registered: 2008-09-01
Posts: 29

Re: Text expansion in python

hmmm, interesting.  It is safe to assume that text complete only works within the mozilla family of programs, right?  i am looking for something that will work in text editors and other programs as well.  Thank you for the info.

Offline

#5 2008-09-05 17:29:36

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,893
Website

Re: Text expansion in python

well yes it does.... tried snippet and autohotkey [not sure on name!] but was a long time ago

Snippet may be your best bet


Mr Green

Offline

#6 2008-09-05 21:50:11

pauldonnelly
Member
Registered: 2006-06-19
Posts: 776

Re: Text expansion in python

Mr Green wrote:

autohotkey

That one is Windows only, I think.

Offline

#7 2008-09-05 22:38:39

scooterpd
Member
Registered: 2008-09-01
Posts: 29

Re: Text expansion in python

i looked into snippits (http://ben.kudria.net/code/snippits), but i am not sure how to get it working on arch linux.  i can download the .tgz source, but i dont know how to compile and install it yet.  that is something i will have to look into. 
Thanks a lot for your help.  I appreciate it.

Offline

#8 2009-01-06 11:47:29

sessy
Member
Registered: 2006-01-20
Posts: 104

Re: Text expansion in python

Here is a rough outline to install it:

sudo pacman -S ruby rubygems xsel
sudo gem install snippits
yaourt xautomation
mkdir ~/.snippits
cat '{shift}{control}{left}{shift}c{control}{paste}' > ~/.snippits/do
cat 'it worked' > ~/.snippits/wo
Now create a shortcut with your DE that runs: ks do. Open kedit/getit, enter "wo" and press the shortcut key.

Unfortunately it can't output @ sing since the last major X update.

HTH

Offline

Board footer

Powered by FluxBB