summaryrefslogtreecommitdiff
path: root/sshclip
blob: 4a4de8d2b47b52aa6c8ce3d835a45aa83e494254 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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