feat(scripts): ssh connect helper
This commit is contained in:
parent
2de2f1722a
commit
8ab3402690
2 changed files with 14 additions and 0 deletions
|
@ -240,6 +240,7 @@ in
|
||||||
#tmux = "tmux -f ~/.config/tmux/tmux.conf attach || tmux -f ~/.config/tmux/tmux.conf new";
|
#tmux = "tmux -f ~/.config/tmux/tmux.conf attach || tmux -f ~/.config/tmux/tmux.conf new";
|
||||||
bunx = "bun --bun x";
|
bunx = "bun --bun x";
|
||||||
g = "lazygit";
|
g = "lazygit";
|
||||||
|
s = "/home/mrflos/Code/nixos-config/scripts/ssh-connect";
|
||||||
t = "/home/mrflos/Code/nixos-config/scripts/tmux-sessionizer";
|
t = "/home/mrflos/Code/nixos-config/scripts/tmux-sessionizer";
|
||||||
kdenix = "nix run github:pjones/plasma-manager --extra-experimental-features nix-command --extra-experimental-features flakes > /home/mrflos/Developpements/nixos-config/modules/home-plasma.nix";
|
kdenix = "nix run github:pjones/plasma-manager --extra-experimental-features nix-command --extra-experimental-features flakes > /home/mrflos/Developpements/nixos-config/modules/home-plasma.nix";
|
||||||
icat = "kitty +kitten icat";
|
icat = "kitty +kitten icat";
|
||||||
|
|
13
scripts/ssh-connect
Executable file
13
scripts/ssh-connect
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [[ $# -eq 1 ]]; then
|
||||||
|
selected=$1
|
||||||
|
else
|
||||||
|
selected=$(grep -P "^Host ([^*]+)$" $HOME/.ssh/config | sed 's/Host //' | sort -r -f | fzf)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z $selected ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
ssh $selected
|
Loading…
Add table
Reference in a new issue