Skip to content

skebi69/shuttle

 
 

Repository files navigation

Shuttle

Join the chat at https://gitter.im/fitztrev/shuttle

A simple SSH shortcut menu for OS X

http://fitztrev.github.io/shuttle/

How Shuttle works

Sidenote: Many people ask, so here's how I have my terminal setup.

Installation

  1. Download Shuttle
  2. Copy to Applications

JSON Path Change

In your home directory create a file called ~/.shuttle.path In this file should be a single line with the path to the JSON settings file.

/Users/thshdw/Dropbox/shuttle/shuttle.json

shuttle will read ~/.shuttle.path first and use its contents as the path to your JSON file.

JSON Options

Global settings

"editor": "VALUE",

This changes the app that opens settings.json for editing (Global Setting)

Possible values are default, nano, vi, vim or any terminal based editor. default opens settings.json in whatever app is registered as the default for extension .json

"editor": "vim",

would open ~/.shuttle.json in vim


"launch_at_login": VALUE,

This allows you to flag the shuttle.app to start automatically (Global Setting)

Possible values are true or false


"terminal": "VALUE",

This allows you to set the default terminal (Global Setting)

Possible values are Terminal.app or iTerm


"iTerm_version": "VALUE",

This changes the applescripts for iTerm (Global Setting)

Possible values are stable or nightly

If terminal is set to iTerm this setting is mandatory

This setting is ignored if your terminal is set to Terminal.app


"default_theme": "Homebrew",

This sets the Terminal theme for all windows. (Global Setting)

Possible values are the Profile names in your terminal preferences. iTerm ships with one Profile named "Default". OS X Terminal ships with several. To see the names see the preferences area of the terminal you are using.

In iTerm the profile names are case sensitive.

Please ensure the theme names you set are valid. If shuttle passes theme "Dagobah" and it does not exist in iTerm or OS X Terminal then your command won't run. This is because the applescripts are not making any checks to see if the theme you passed actually exists within the terminal application.

This setting can be overwritten by the command level "theme" settings


"open_in": "VALUE",

This changes the default action for how commands are opened (Global Setting)

Possible values are tab or new.

tab opens the command in the active terminal in a new tab.

new opens the command in a new window.

This setting can be overwritten by the command level "inTerminal" settings


"show_ssh_config_hosts": VALUE,

This changes parsing ssh config. By default, Shuttle will parse your ~/.ssh/config file for hosts. (Global Setting)

Possible values are false or true


"ssh_config_ignore_hosts": ["VALUE", "VALUE"],

This will ignore hosts in the ssh config. (Global Setting)

Possible values are the hosts in your config that you want to ignore. If you had github.com and git.example.com in your ssh config, to ignore them you set:

"ssh_config_ignore_hosts": ["github.com", "git.example.com"],


"ssh_config_ignore_keywords": ["VALUE"],

This will ignore keywords in your ssh config. (Global Setting)

Possible values are the keywords in your ssh config that you want to ignore.


Additional ssh config customization

Nested menus for ~/.ssh/config hosts

Create a menu item at "work" > "servers" > "web01"
Host work/servers/web01
        HostName user@web01.example.com

- or -

Host gandalf
        # shuttle.name = work/servers/web01 (webserver)
        HostName user@web01.example.com

Command level settings

Command level settings are unique to your command and will overwrite the Global setting equivalent

"cmd": "VALUE"

This is the command / script that will be launched in the terminal. (Command setting)

Where Value is a command or script.

"cmd": "ps aux | grep [s]sh"

Would check for ssh processes.


"name": "VALUE"

This sets the text that will appear in shuttles drop down menu. (Command setting)

Were Value is the text you want to see in the drop down menu for this command.

"name": "SSH to my wordpress blog"

This value can also set the title of the terminal window if "title" :"VALUE" is not set.


"inTerminal": "VALUE",

This sets how command will open in the terminal window. (Command setting)

Possible values are new, tab, or current

new opens the command in a new terminal window.

tab opens the command in the active terminal window in a new tab.

current opens the command in the active terminal's window.

When using using current I recommend that you wrap the command in some user input like this:

echo "are you sure y/n"; read sure; if [ "$sure" == "y" ]; then echo "running command" && ps aux | grep [s]sh; else echo "exiting..."; fi

Do this as a precaution as it could be possible to run a command on the wrong host.


"theme": "VALUE",

This sets the theme for the terminal window. (Command setting)

Possible values are the profile names for iTerm or OS X Terminal.

If "theme" is not set and "default_theme" is not set then shuttle passes Profile Default for iTerm and Profile basic for OS X terminal.


"title": "VALUE"

This sets the text that will appear in the terminal's title bar. (Command setting)

Where VALUE is the text you want to set in the terminals title bar.

If title is missing shuttle uses the menu's name and sets this as title

Roadmap

  • Cloud hosting integration
    • AWS, Rackspace, Digital Ocean, etc
    • Using their APIs, automatically add all of your machines to the menu
  • Preferences panel for easier configuration
  • Update notifications
  • Keyboard hotkeys
    • Open menu
    • Select host option within menu

Contributors

This project was created by Trevor Fitzgerald. I owe many thanks to the following people who have helped make Shuttle even better.

(In alphabetical order)

  • Alex Carter
  • Dave Eddy
  • Dmitry Filimonov
  • Frank Enderle
  • Jack Weeden
  • Justin Swanson
  • Marco Aurélio
  • Martin Grund
  • Michael Davis
  • Rui Rodrigues
  • Ryan Cohen
  • Thomas Rosenstein
  • Tibor Bödecs

Credits

Shuttle was inspired by SSHMenu, the GNOME applet for Linux.

I also looked to projects such as MLBMenu and QuickSmileText for direction on building a Cocoa app for the status bar.

About

A simple SSH shortcut menu for OS X

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 78.5%
  • AppleScript 18.4%
  • Shell 3.1%