Tags

,

Terminal applications like iTerm2 are a great way to improve your efficiency when connecting to a remote host on your Mac.  As I started making my own shortcut keys I hit the wall.

When I have an OEM agent to check, I’ll log into the box, sudo to the binary owner, go the agent bin directory, and execute emctl status agent.

Here’s the wall:  Shortcut keys from iTerm could change directory and execute a command, but each step needs its own shortcut. I want one keystroke to get me there and give me a status.

This is where BetterTouchTool comes in.

The first step is to define the application the action will work with in the left panel.  Hit the + button and select iTerm from the list.

btt_01

In the right-hand panel press Add New Shortcut and give it a shortcut key.

btt_02

Under the Predefined Actions drop-down, open the Utility Actions group and select Paste Custom Text.  Type your text into the pop-up.

btt_07

This is where the magic happens.  Press the Attach Additional Action button and tell it you want to record a keystroke.  Hit the Enter key.

btt_03

Repeat that sequence for each additional task

  • Trigger predefined action
  • Paste Custom Text (./emctl status agent)
  • Trigger another keyboard shortcut for a hard return …

 

BTW:  The tab for Attach Additional Action may be greyed-out.  Select it anyhow.