Skip to content

Instantly share code, notes, and snippets.

@bendog
Last active August 16, 2017 04:58
Show Gist options
  • Select an option

  • Save bendog/2f1a31ba9e53f8139f796e88539bd1ab to your computer and use it in GitHub Desktop.

Select an option

Save bendog/2f1a31ba9e53f8139f796e88539bd1ab to your computer and use it in GitHub Desktop.

Revisions

  1. bendog revised this gist Aug 16, 2017. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion ssh
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,6 @@
    HOSTNAME=`echo $@ | sed s/.*@//`

    set_bg () {
    # osascript -e "tell application \"Terminal\" to set background color of window 1 to $1"
    osascript -e "tell application \"Terminal\" to set current settings of window 1 to (first settings set whose name is \"$1\")"
    }

  2. bendog created this gist Aug 16, 2017.
    20 changes: 20 additions & 0 deletions ssh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    #!/bin/sh

    HOSTNAME=`echo $@ | sed s/.*@//`

    set_bg () {
    # osascript -e "tell application \"Terminal\" to set background color of window 1 to $1"
    osascript -e "tell application \"Terminal\" to set current settings of window 1 to (first settings set whose name is \"$1\")"
    }

    on_exit () {
    set_bg "BenDog"
    }
    trap on_exit EXIT

    case $HOSTNAME in
    bendog.org|celeste.bendog.org) set_bg "bendog.org" ;;
    *) set_bg "ssh" ;;
    esac

    /usr/bin/ssh "$@"