Saving keystrokes with AutoKey
![](/var/linux_magazin/storage/images/online/blogs/off-the-beat-bruce-byfield-s-blog/318120-13-eng-US/Off-the-Beat-Bruce-Byfield-s-Blog.png)
Off the Beat: Bruce Byfield's Blog
AutoKey reminds me of OpenOffice.org Writer's AutoText feature. With AutoText, you can save often-used text or images and assign them a keyboard shortcut to paste them at the mouse cursor. AutoKey is a similar feature, except that it can be used anywhere on your GNOME or KDE desktop. You can use it like AutoText in open applications, or to run Python scripts on the desktop.
AutoKey is available as a zipped tar file or as a .DEB package for Ubuntu or Debian. However, it requires Python 6.0, which Debian currently does not carry. You will also need to install three dependencies -- python-configobj, python-xlib, and python-gamin -- even if you are using the .DEB package, since the package does not automatically resolve dependencies, the way it is supposed to.
Once installed, AutoKey sits in the notification tray. The first time you run the utility, AutoKey opens a configuration window so that you can enter the phrases you want to use, and arrange them in folders for easy reference.
![](/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/screenshot-autokey-configuration/366357-1-eng-US/Screenshot-AutoKey-Configuration.png)
A phrase is any string of text that you choose to enter. On the most basic level, it is a a piece of text, such as your street address, that you would prefer not to be continually typing. On a more sophisticated level, you could store common commands to insert into a virtual terminal to save you time and omit the possibility of typos. On a more advanced level, you can run Python scripts for everything from the insertion of the current date in a particular format to the opening of a program with a couple of key strokes. AutoKey detects the end of lines, but otherwise phrases cannot be formatted.
However, you do have considerable control over how you insert a phrase. You can opt to have AutoKey automatically paste the phrase when its first five letters are typed (you can select Settings -> Advanced Settings -> General to change this default, but any less is likely to be a nuisance). If you are more cautious, you can confirm the use of the phrase before AutoKey pastes it.
Alternatively, you can choose to display the phrase in the AutoKey menu. Then you can right-click the icon in the notification tray, and select it from the displayed items.
Another option is to select a hotkey to insert the phrase. You can use the Control, Alt, and Shift keys, or a Super key if you have defined one, plus any single key. The disadvantage, of course, is that using a hotkey requires you to remember it if you want its full advantage.
However, for most people, I suspect that the preferred choice is to set an abbreviation, which you enter after clicking the notification tray icon. Since the abbreviation only works after you click, AutoKey avoids the nuisance of popping up whenever you type the abbreviation within a document, and spares you trying to generate an abbreviation that you are unlikely to type by accident.
The advantage of an abbreviation is that it gives you more options than any other choice. You can choose, for example, for the pasted string to match the case of the abbreviation, or to ignore it. Still another option is to trigger the abbreviation when it is part of a word. You can also choose to ignore the Space and Enter keys when using the abbreviation.
By default, all AutoKey phrases will work in any window on your desktop -- although one advanced setting does indicate that phrases might be garbled when based in windows drawn by Qt 4.0. However, on the Window Filter tab for the phrase, you can choose to deselect the Trigger in all windows options, and specify the title of the windows in which you want the phrase to operate, using wild cards if necessary. This option allows you to customize phrases to the application, and, by adding a specific context, helps to overcome the limitations of being able to use only a single key in the shortcut.
While setting up phrases, you might also want to adjust the advanced settings. Besides the couple already mentioned, you might not want phrases to be listed in the AutoKey menu in the order that they are most frequently used, or to adjust the default hotkeys reserved for AutoKey itself. You might also want to adjust the Device Interface between AutoKey and the keyboard and mouse if the utility is not working properly.
AutoKey is still in development, so it has its faults. Wanting an AutoText for the entire desktop, some users might want it to support basic image formats. Personally, I would like to see an option to add phrases from the clipboard -- or, better yet, to include a multi-item clipboard like Klipper for the temporary storage of phrases.
However, AutoKey is already a handy tool, easy to use and efficient once you have it configured for your use. And if you don't believe me, just click Help -> About, and AutoKey will tell you how many keystrokes it has saved you. You may be surprised how quickly those saved keystrokes add up.
Comments
comments powered by DisqusSubscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
First Release Candidate for Linux Kernel 6.14 Now Available
Linus Torvalds has officially released the first release candidate for kernel 6.14 and it includes over 500,000 lines of modified code, making for a small release.
-
System76 Refreshes Meerkat Mini PC
If you're looking for a small form factor PC powered by Linux, System76 has exactly what you need in the Meerkat mini PC.
-
Gnome 48 Alpha Ready for Testing
The latest Gnome desktop alpha is now available with plenty of new features and improvements.
-
Wine 10 Includes Plenty to Excite Users
With its latest release, Wine has the usual crop of bug fixes and improvements, along with some exciting new features.
-
Linux Kernel 6.13 Offers Improvements for AMD/Apple Users
The latest Linux kernel is now available, and it includes plenty of improvements, especially for those who use AMD or Apple-based systems.
-
Gnome 48 Debuts New Audio Player
To date, the audio player found within the Gnome desktop has been meh at best, but with the upcoming release that all changes.
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
Autokey in Debian
just wanted to let you know, autokey is now in debian testing + unstable, as well as ubuntu karmic. http://packages.debian.org/unstable/autokey
Thanks,
Luke Faraone
http://luke.faraone.cc