From 6890e54cb3d4a352fc791a782ca0f908381b116f Mon Sep 17 00:00:00 2001 From: tsxv478 Date: Tue, 18 Jun 2024 00:32:33 +0300 Subject: sshmenu script --- sshmenu | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 sshmenu diff --git a/sshmenu b/sshmenu new file mode 100755 index 0000000..4902b10 --- /dev/null +++ b/sshmenu @@ -0,0 +1,15 @@ +#!/bin/sh + +if [ $DISPLAY ]; then + host=$(grep "^Host" $HOME/.ssh/config | cut -d ' ' -f 2 | dmenu -i -c -l 10 -p "SSH to:") + + [ "$host" ] || exit 0 + + setsid -f $TERMINAL -e ssh $host -t "tmux new -A" +else + host=$(grep "^Host" $HOME/.ssh/config | cut -d ' ' -f 2 | fzf -e --reverse --prompt "SSH to: ") + + [ "$host" ] || exit 0 + + ssh $host -t "tmux new -A" +fi -- cgit v1.2.3