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
-
Linux Servers Targeted by Akira Ransomware
A group of bad actors who have already extorted $42 million have their sights set on the Linux platform.
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
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