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
-
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
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.
-
ZorinOS 17.1 Released, Includes Improved Windows App Support
If you need or desire to run Windows applications on Linux, there's one distribution intent on making that easier for you and its new release further improves that feature.
-
Linux Market Share Surpasses 4% for the First Time
Look out Windows and macOS, Linux is on the rise and has even topped ChromeOS to become the fourth most widely used OS around the globe.
-
KDE’s Plasma 6 Officially Available
KDE’s Plasma 6.0 "Megarelease" has happened, and it's brimming with new features, polish, and performance.
-
Latest Version of Tails Unleashed
Tails 6.0 is based on Debian 12 and includes GNOME 43.
-
KDE Announces New Slimbook V with Plenty of Power and KDE’s Plasma 6
If you're a fan of KDE Plasma, you'll be thrilled to hear they've announced a new Slimbook with an AMD CPU and the latest version of KDE Plasma desktop.
-
Monthly Sponsorship Includes Early Access to elementary OS 8
If you want to get a glimpse of what's in the pipeline for elementary OS 8, just set up a monthly sponsorship to help fund its continued existence.
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