Using a Mac keyboard in Lubuntu 13.10 March 30, 2014 · 0 Comments

sudo apt-get install autokey-gtk

Run autokey by typing autokey in a terminal. You can find a beginner’s guide to autokey here.

You can create a new folder for your scripts (by clicking on the New button). I recommend ~/bin/autokey as the folder to keep all your files. Once you create the folder, you can now add scripts and phrases to this folder.

Let’s take the most used keyboard shortcut – Control+C for copying. This method will not replace Control+C by Command+C. Instead, we will bind the Command+C to Control+C. This way both these keyboard shortcuts will do the same thing – copying. This is exactly why this method is not my favorite. It essentially renders both Control and Command equivalent. I recommend the first method of changing Openbox configuration in lubuntu-rc.xml as the best. Next best method is to change key bindings in the application itself (like we did for Sublime Text 3). Finally, since we have no other options, we have to use autokey for the remaining shortcut keys.

There are two ways you can do this – scripts and phrases. Both can bind the key combinations we want in the same way. You can choose whichever one you like. Phrases might feel a tad simpler. I describe both methods below.

SCRIPTS

Click on New > Script. Give the script a name such as copy. In the big text box, replace

# Enter script code

by

keyboard.send_keys(“<ctrl>+c”)

Then, set the Hotkey as Super+c. Save the script by clicking on Save. Saving the script will create a file copy.txt in the folder location you chose. Repeat this method for many other shortcuts. You can take a look or download my autokey folder here.

PHRASES

Click on New > Phrase. Give the phrase a name such as copy. In the big text box, replace

Enter phrase contents

by

<ctrl>+c

Then, set the Hotkey as Super+c. Save the phrase by clicking on Save. Saving the phrase will create a file copy.txt in the folder location you chose. Repeat this method for many other shortcuts. You can take a look or download my autokey folder here.

Obviously, you only need to create a script or a phrase for a key binding. Creating both a script and phrase with the same name will most probably overwrite the file.

You can test the new keyboard shortcuts. As long as autokey is running, the scripts and phrases will work. All we now need to do is make sure autokey runs at startup. You can add autokey to your list of startup programs.

Leave a Comment