How AutoKey can make repetitive tasks, like configuring Netplan, easier

AutoKey is a helpful GUI software that may take the repetition out of loads of your each day Linux admin duties.


Picture: jivacore/Shutterstock

I’ve loads of repetitive duties I do all through the day. For instance, I’ve to kind out the identical lengthy header for articles recurrently. At one level, I saved a file that contained the header contents however realized utilizing it brought on me additional clicks, all of which amounted to creating my day a bit much less environment friendly. There are additionally the Netplan configurations I make each day. I often deploy Ubuntu Server as a digital machine, and having to at all times configure networking is only one extra step I do not need to need to take.

Easy methods to turn into a community administrator: A cheat sheet (TechRepublic)

That is why I make use of just a little Linux software known as AutoKey, which is a GUI software for creating boilerplate textual content information and extra sophisticated macros that can be utilized for absolutely anything. As soon as you have created a brand new “phrase” you possibly can assign the phrase a hotkey. With the phrase full, all you must do is hit the hotkey and the phrase is then added to the doc you might be utilizing.

AutoKey additionally lets you create “scripts,” that are extra superior choices that help you do issues like open purposes/information/folders, management window and mouse occasions, show menu entries to pick out from, and different issues.

I’ll present you learn how to set up AutoKey on a Debian-based distribution after which stroll you thru learn how to create a phrase that may paste the contents of Netplan into an open file.

What you will want

To make this work, you will want a operating occasion of a Debian-based Linux desktop (I am utilizing Pop!_OS 21.04) and a person with sudo privileges. That is it. Let’s make some desktop magic.

Easy methods to set up AutoKey

AutoKey will be present in the usual repositories. There are two editions: A GTK and Qt variant. Which you put in will rely on the desktop surroundings you might be utilizing. For example, in case your desktop of selection is GNOME, you will set up the GTK model of AutoKey. If, alternatively, you utilize KDE, the Qt model is what you need.

To put in the GTK model of AutoKey, open a terminal window and problem the command:

sudo apt-get set up autokey-gtk -y

To put in the Qt model, the command is:

sudo apt-get set up autokey-qt -y

As soon as the set up is full, you will discover an AutoKey entry in your desktop menu. Launch the appliance after which set it to run at boot by clicking Edit | Preferences after which click on the checkbox for Mechanically begin AutoKey at login (Determine A).

Determine A


Configuring AutoKey to run at begin.

Easy methods to create your first phrase

We’re now going to create our first phrase that may paste the contents for a Netplan community configuration (so you do not have to at all times bear in mind the structure or kind it out manually). From the AutoKey window, click on the New drop-down and choose Phrase. Within the popup, give the phrase a reputation (comparable to NETPLAN) and click on OK. 

With the brand new phrase created, you will then add the contents of your Netplan file within the higher proper pane (Determine B).

Determine B


Including the contents for a Netplan configuration into AutoKey.

With the Netplan contents in place, it is time to assign a hotkey. Within the Phrase Settings pane, click on the Set button related to Hotkey. A brand new window will pop up (Determine C). Click on Press to Set.

Determine C


Setting a hotkey mixture for our new phrase.

You’ll then kind the important thing mixture you need to use for the phrase. As soon as you have executed that, press OK to shut the popup. Lastly, click on Save and your phrase is able to go. 

Easy methods to use a brand new phrase

At this level, open a connection to a newly deployed Netplan-enabled server, open the netplan configuration (or create a brand new one), after which hit the newly created hotkey to have the contents of the phrase pasted into the file. You will most likely want to change the IP deal with for the configuration, however you will not need to both bear in mind the YAML configuration for netplan or kind out your complete configuration manually.

At this level, you are most likely asking your self, “How did he SSH into that digital machine if networking hasn’t been already configured?” The way in which I work that is to create a reasonably normal digital machine, with a primary working community configuration. I then clone the essential machine (realizing the default IP deal with I’ve set within the primary configuration), SSH into that machine, and alter the Netplan configuration as wanted. 

That is simply one of many some ways you need to use AutoKey. I’ve discovered this software to be invaluable for serving to make my day a bit extra environment friendly. Give AutoKey a attempt to see what intelligent use circumstances you possibly can give you for the software.

Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the most recent tech recommendation for enterprise professionals from Jack Wallen.

Additionally see

Recent Articles


Related Stories

Leave A Reply

Please enter your comment!
Please enter your name here

Stay on op - Ge the daily news in your inbox