|
|
SSH_HOST: New Version
I've updated the script so that it no longer uses binary special characters, but echo -e instead (thanks kenahoo). Also, it now chooses a default background color based on the first three characters of the hostname, if you haven't set up a match by default. It maps a-z to 0-65535 for red, green, and blue. This is not guaranteed to produce eye pleasing colors (e.g. ssh_host zzz would be non-ideal with white text), so do setup explicit matches in problem cases. You could probably also set the text color based on the absolute luminance of the bg color, but I didn't implement that.
SSH_HOST: New Version
Sweeeet! I often ssh in as another username, so to strip out the username from the "ssh user@hostname" evocation, I changed your color-fetching line to
SSH_HOST: New Version
and I should add, if you ssh into servers named "www" you should put specifc colors into the case statement, lest your screen go to a very pale grey.
SSH_HOST: New Version
Very nice indeed. But of course I needed some tweaks :-) - since my terminal windows start out with custom colors, I wanted to save the current settings and then restore them on cleanup.
So far I added the following to the set_color() function:
and in the cleanup function I changed the resetting of the color to:
Next I'll probably add support for setting the foreground text color. And then probably the hightlight color, cursor color etc, since those need to all track each other. Should be straightforward now given this template. This is something I've wanted/needed for a while. I kept making mistakes by entering commands to the wrong machine - but no more. Thanks for the kick start! Then, how 'bout a version that works in an xterm? I often use an xterm so that I can launch remote X apps. Unfortunately AppleScript won't be available in that case. Any ideas? Ideally it would all be in one script... |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.09 seconds |
|