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
-
Gnome 47.1 Released with a Few Fixes
The latest release of the Gnome desktop is all about fixing a few nagging issues and not about bringing new features into the mix.
-
System76 Unveils an Ampere-Powered Thelio Desktop
If you're looking for a new desktop system for developing autonomous driving and software-defined vehicle solutions. System76 has you covered.
-
VirtualBox 7.1.4 Includes Initial Support for Linux kernel 6.12
The latest version of VirtualBox has arrived and it not only adds initial support for kernel 6.12 but another feature that will make using the virtual machine tool much easier.
-
New Slimbook EVO with Raw AMD Ryzen Power
If you're looking for serious power in a 14" ultrabook that is powered by Linux, Slimbook has just the thing for you.
-
The Gnome Foundation Struggling to Stay Afloat
The foundation behind the Gnome desktop environment is having to go through some serious belt-tightening due to continued financial problems.
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.
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