mirror of
https://github.com/prdlk/television.git
synced 2026-11-02 13:12:51 +00:00
19 lines
530 B
TOML
19 lines
530 B
TOML
[metadata]
|
|
name = "ssh-hosts"
|
|
description = "A channel to select hosts from your SSH config"
|
|
requirements = ["grep", "tr", "cut", "awk"]
|
|
|
|
[source]
|
|
command = "grep -E '^Host(name)? ' $HOME/.ssh/config | tr -s ' ' | cut -d' ' -f2- | tr ' ' '\n' | grep -v '^$'"
|
|
|
|
[preview]
|
|
command = "awk '/^Host / { found=0 } /^Host (.*[[:space:]])?'{}'([[:space:]].*)?$/ { found=1 } found' $HOME/.ssh/config"
|
|
|
|
[keybindings]
|
|
enter = "actions:connect"
|
|
|
|
[actions.connect]
|
|
description = "SSH into the selected host"
|
|
command = "ssh {}"
|
|
mode = "execute"
|