LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 06-14-2021, 08:27 PM   #1
JavaMeister
Member
 
Registered: Jul 2017
Location: NC
Distribution: Ubuntu 20.04
Posts: 34

Rep: Reputation: Disabled
shortcut (hot key) definition


How can I set up a shortcut to output a text string wherever the cursor is in Ubunbu 18.04? I want to map the shortcut to a key combination.
 
Old 06-14-2021, 08:56 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,317
Blog Entries: 28

Rep: Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140
Keyboard shortcuts are normally managed by the window manager/desktop environment. What desktop environment are you using?

If it's the default, Gnome, this may help: https://help.gnome.org/users/gnome-h...ts-set.html.en
 
Old 06-15-2021, 07:38 AM   #3
JavaMeister
Member
 
Registered: Jul 2017
Location: NC
Distribution: Ubuntu 20.04
Posts: 34

Original Poster
Rep: Reputation: Disabled
Thank you for that very helpful reference. Can you give me a clue why my attempt does not work?

I defined a shortcut named EmailAddr to be "echo Ron39@gmail.com" and it does not work. The command works fine in the terminal.

I also tried "bash echo Ron39@gmail.com" but that command does NOT work in the terminal. The terminal says it cannot execute a binary file. It also does not work as a shortcut.

Yes, I am using Gnome 3.36.8 in Ubuntu 20.04 LTS.

Last edited by JavaMeister; 06-15-2021 at 07:39 AM. Reason: formatting
 
Old 06-15-2021, 10:51 AM   #4
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,138

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
The Gnome shortcuts are for creating commands. If I understand you, you want to be able to use a short-cut just to save typing in a string in any application. If that's the case, just install the program autokey from the Ubuntu repository. It looks a bit complicated but it's worth trying: Beginners-Guide
 
Old 06-16-2021, 07:48 AM   #5
JavaMeister
Member
 
Registered: Jul 2017
Location: NC
Distribution: Ubuntu 20.04
Posts: 34

Original Poster
Rep: Reputation: Disabled
Thanks. autokey really did the trick.

I am surprised that there does not seem to be a "native" way to do this, "native" to Linux, Ubuntu, Gnome, etc.
autokey has a LOT of power. It requires one know or learn Python to use most of it.
 
Old 06-16-2021, 11:03 AM   #6
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,138

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
I'm glad you like it — I might try it myself. I too am surprised this isn't built in. Years ago on my Sinclair QL, one could create shortcuts on the fly, or in a script to run at the start, using the Alt key. So
Code:
altkey "m", "Testing!" \ "Hello world"
would enable alt-m to print the two messages at the cursor, separated by a line feed. Occasionally QDOS could reach places that Linux couldn't — the built-in alarm clock was also handy.
 
  


Reply

Tags
shortcuts



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I made a global shortcut to block an unwanted in-application shortcut newbiesforever LinuxQuestions.org Member Success Stories 0 07-22-2018 07:49 PM
Hot? You want...hot??? I dont... ButterflyMelissa Linux - Hardware 11 08-08-2013 05:30 AM
[SOLVED] Linux Mint 13 "hot corner" shortcut custangro Linux Mint 1 05-27-2012 02:54 PM
[KDE]Shortcut Icons smaller, Shortcut And Tray icons on 2 lines xeross Linux - Newbie 2 04-10-2008 10:20 AM
rndc: no key definition for name rncd.key forkvoid Linux - Networking 2 12-29-2003 03:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 05:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration