meduzen / hyper-custom-touchbar

Add custom buttons to the Macbook's Touch Bar when using Hyper terminal.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hyper Custom Touchbar

hyper-custom-touchbar is a TouchBar plugin for Hyper.app. It replaces the TouchBar area with user-defined executable commands.

Install

To install, edit ~/.hyper.js and add 'hyper-custom-touchbar' to plugins:

module.exports = {
  ...
  plugins: ['hyper-custom-touchbar']
  ...
}

Custom TouchBar Buttons

Following is what my shortcuts look like but feel free to change them as you like to better suit your development needs.

Add the following to ~/.hyper.js

module.exports = {
  config: {
    ...
      hyperCustomTouchbar: [
      {
        label: 'git',
        options: [
          { label: 'diff',  command: 'git diff' },
          { label: 'status',  command: 'git status' },
          { label: 'log',  command: 'git log' },
          { label: 'add .',  command: 'git add .' },
          { label: 'clone',  command: 'git clone ', prompt: true },
        ]
      },
      {
        label: 'cd',
        options: [
          { label: 'nginx', command: 'cd /usr/local/etc/nginx' },
          { label: 'log', command: 'cd /usr/local/var/log' },
        ]
      },
      {
        label: 'vim',
        options: [
          { label: 'quit', command: ':q!', esc: true },
          { label: 'save & quit', command: ':x', esc: true },
        ]
      },
    ]
    ...
  }
}

Please note that label and command are always mandatory. The optional keys are:

  • esc (default is false): setting esc to true will be like pressing the Escape key before your command runs, instead of the classic Ctrl+C, which is useful in contexts (e.g. VIM) where the running operation can’t be stopped by Ctrl+C.
  • prompt(default is false): by setting prompt to true, the plugin won’t press the Enter key after writing the command, so that the user can complete the command by a custom input (see example with git clone ; notice the space ending the command).

And now restart you Hyper terminal and you should see populated touch bar.

Screenshot

Screenshot

License

This project is licensed under the MIT License - see the LICENSE file for details

About

Add custom buttons to the Macbook's Touch Bar when using Hyper terminal.

License:MIT License


Languages

Language:JavaScript 100.0%