diff options
author | Jesse Morgan <jesse@jesterpm.net> | 2013-07-04 11:11:07 -0700 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net> | 2013-07-04 11:11:07 -0700 |
commit | 98a2554ee29415a5cf7965114975b875d0d3f74a (patch) | |
tree | 1097d63935c69556cd5ff06080592bf7c0b9739e /sshclip | |
parent | eb80ea41be3dc36ec99d3506c6da3efa47dc9fe2 (diff) |
Creating sshclip.
sshclip is a script which opens a ssh session to the hostname in the
clipboard in your favorite terminal.
Diffstat (limited to 'sshclip')
-rwxr-xr-x | sshclip | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -0,0 +1,17 @@ +#!/bin/sh + +# Open a SSH session to the hostname in the clipboard +# Requires the xclip package to be installed. + +HOSTNAME=$(xclip -out|cut -d' ' -f1) + +if [ -z "$HOSTNAME" ]; then + HOSTNAME=$(xclip -out -selection secondary|cut -d' ' -f1) +fi + +if [ -n "$HOSTNAME" ]; then + i3-sensible-terminal -e ssh $HOSTNAME & +else + notify-send "No hostname in clipboard" + exit 1 +fi |