From 98a2554ee29415a5cf7965114975b875d0d3f74a Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Thu, 4 Jul 2013 11:11:07 -0700 Subject: Creating sshclip. sshclip is a script which opens a ssh session to the hostname in the clipboard in your favorite terminal. --- sshclip | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 sshclip diff --git a/sshclip b/sshclip new file mode 100755 index 0000000..4a4de8d --- /dev/null +++ b/sshclip @@ -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 -- cgit v1.2.3