From a2287467b974c13e35016997c9dd84fea0491b5d Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 26 Oct 2026 11:03:50 +0100 Subject: feat(sshmenu): open the host in a tab of the running kitty kitten @ launches it through the socket kitty.conf's listen_on opens, then Hyprland focuses the kitty window. Falls back to a new terminal when no kitty socket answers. Co-Authored-By: Claude Opus 5.5 --- bin/blackpearl-sshmenu.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'bin') diff --git a/bin/blackpearl-sshmenu.sh b/bin/blackpearl-sshmenu.sh index b0a0fc1..1092b83 100755 --- a/bin/blackpearl-sshmenu.sh +++ b/bin/blackpearl-sshmenu.sh @@ -37,4 +37,13 @@ done i=$(IFS='|'; printf '%s' "${entries[*]}" | rofi -dmenu -i -markup-rows \ -sep '|' -eh 2 -format i -p '󰆍 SSH:' -theme ~/.config/rofi/udt/ssh.rasi) || exit name=${hosts[i]%%$'\t'*} + +# A tab in the running kitty, through the socket kitty.conf's listen_on opens; +# a new terminal when no kitty is up. +# ponytail: first socket wins when several kitty instances run. +sockets=("$XDG_RUNTIME_DIR"/kitty-*) +if [[ -S ${sockets[0]} ]] && kitten @ --to "unix:${sockets[0]}" launch \ + --type=tab --tab-title "$name" ssh "$name" >/dev/null; then + exec hyprctl dispatch 'hl.dsp.focus({ window = "class:kitty" })' >/dev/null +fi exec rofi-sensible-terminal -e ssh "$name" -- cgit v1.2.3