Saving keystrokes with AutoKey

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.
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.
News
-
Fedora 39 Beta is Now Available for Testing
For fans and users of Fedora Linux, the first beta of release 39 is now available, which is a minor upgrade but does include GNOME 45.
-
Fedora Linux 40 to Drop X11 for KDE Plasma
When Fedora 40 arrives in 2024, there will be a few big changes coming, especially for the KDE Plasma option.
-
Real-Time Ubuntu Available in AWS Marketplace
Anyone looking for a Linux distribution for real-time processing could do a whole lot worse than Real-Time Ubuntu.
-
KSMBD Finally Reaches a Stable State
For those who've been looking forward to the first release of KSMBD, after two years it's no longer considered experimental.
-
Nitrux 3.0.0 Has Been Released
The latest version of Nitrux brings plenty of innovation and fresh apps to the table.
-
Linux From Scratch 12.0 Now Available
If you're looking to roll your own Linux distribution, the latest version of Linux From Scratch is now available with plenty of updates.
-
Linux Kernel 6.5 Has Been Released
The newest Linux kernel, version 6.5, now includes initial support for two very exciting features.
-
UbuntuDDE 23.04 Now Available
A new version of the UbuntuDDE remix has finally arrived with all the updates from the Deepin desktop and everything that comes with the Ubuntu 23.04 base.
-
Star Labs Reveals a New Surface-Like Linux Tablet
If you've ever wanted a tablet that rivals the MS Surface, you're in luck as Star Labs has created such a device.
-
SUSE Going Private (Again)
The company behind SUSE Linux Enterprise, Rancher, and NeuVector recently announced that Marcel LUX III SARL (Marcel), its majority shareholder, intends to delist it from the Frankfurt Stock Exchange by way of a merger.
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