Xfce Forum

Sub domains
 

You are not logged in.

#1 2014-10-24 21:41:50

bobdrad
Member
Registered: 2014-03-25
Posts: 3

How to bind a string to a key?

I'd like to bind a text string to a function key, in an application-independent manner (e.g. whenever I press F12 it issues my phone number to whatever app has focus).

Can this be done in Xfce?

This is for Fedora 20, Xfce version 4.10

Thanks,
    Bob

Last edited by bobdrad (2014-10-24 21:44:03)

Offline

#2 2014-10-25 13:39:08

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 6,032

Re: How to bind a string to a key?

Try creating an application shortcut (Settings Manager >> Keyboard >> Application Shortcuts) that uses the following command:

bash -c "sleep 0.5 && xdotool type 'my@email.com '"

...and assign it to the F12 key.

Offline

#3 2014-10-25 17:28:41

bobdrad
Member
Registered: 2014-03-25
Posts: 3

Re: How to bind a string to a key?

Lol - brilliant! I wonder why the sleep is necessary however? I experimented without it, and it didn't work, so it is really required for some reason...
I was stuck looking for a solution like xmodmap or loadkeys and couldn't get them to work. This is good out-of-box thinking.

Thanks!
Bob

Offline

#4 2014-10-25 18:10:52

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 6,032

Re: How to bind a string to a key?

Yeah, its like the command executes too quickly. Learned long ago to delay it slightly.

Offline

#5 2014-10-25 19:33:33

bobdrad
Member
Registered: 2014-03-25
Posts: 3

Re: How to bind a string to a key?

Have you filed a bug?

Offline

Board footer

Powered by FluxBB