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 isfalse
): settingesc
totrue
will be like pressing theEscape
key before your command runs, instead of the classicCtrl
+C
, which is useful in contexts (e.g. VIM) where the running operation can’t be stopped byCtrl
+C
.prompt
(default isfalse
): by settingprompt
totrue
, the plugin won’t press theEnter
key after writing the command, so that the user can complete the command by a custom input (see example withgit clone
; notice the space ending thecommand
).
And now restart you Hyper terminal and you should see populated touch bar.
License
This project is licensed under the MIT License - see the LICENSE file for details