Coder Social home page Coder Social logo

zhaoqunhe / shuttle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fitztrev/shuttle

0.0 2.0 0.0 3.27 MB

A simple SSH shortcut menu for OS X

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

License: MIT License

Objective-C 78.42% Shell 3.10% AppleScript 18.48%

shuttle's Introduction

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, shuttle's applescripts fall back to the default profile. In iTerm this profile is called Default. If you have removed Default or renamed it shuttle may not open your command.

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 [email protected]

- or -

Host gandalf
        # shuttle.name = work/servers/web01 (webserver)
        HostName [email protected]

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)

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.

shuttle's People

Contributors

fitztrev avatar petethepig avatar tib avatar grundprinzip avatar jackbot avatar geeksunny avatar mortonfox avatar pluwen avatar rmrodrigues avatar thoro avatar bahamas10 avatar imryan avatar gitter-badger avatar blazeworx avatar keesfransen avatar welsonla avatar

Watchers

James Cloos avatar Scott avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.