aboutsummaryrefslogtreecommitdiffstats
path: root/hosts/ssh-tab
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-26 11:25:26 +0100
committerDanilo M. <danix@danix.xyz>2026-10-26 11:25:26 +0100
commitf161ba41344c6834f10eaa5064dc02bc9c1cfdf6 (patch)
tree941d27d5f25c961b4b6fe3f1f68175814255a72a /hosts/ssh-tab
parentcf4f2665ee02058ed65cf08fc2b5f313523f6191 (diff)
downloadquickshell-f161ba41344c6834f10eaa5064dc02bc9c1cfdf6.tar.gz
quickshell-f161ba41344c6834f10eaa5064dc02bc9c1cfdf6.zip
hosts: the vault's LAN map as a searchable overlay
A new standalone shell, shaped like keybinds, that replaces the rofi SSH menu (blackpearl-sshmenu.sh) on ALT+SHIFT+Return. hosts.py reads the frontmatter of every host note in the vault's Local Network/services folder and the plain lines of ~/.ssh/config, and joins each alias to the note whose ip or hostname is its HostName (or whose short hostname is the alias). Aliases that match no note get cards of their own, so everything the rofi menu listed is still reachable. It runs on every opening, so a vault edit shows next time with no cache to go stale. Each card shows ip:port, hostname, the Proxmox node and CT id, and only the actions its data allows: ssh per alias (a kitty tab, via ssh-tab, lifted from the rofi script), open for a url, copy for the address. Enter runs the first. The cards are laid out in rows of five inside a Flickable rather than a GridView, because a GridView gives every cell one height: a fixed height tall enough for the most aliased host left every other card half empty, and a short one clipped its chips. Each row now takes its busiest card's height. The grid keeps a 24px margin inside its clip, without which the first row's glow was cut off at the top. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'hosts/ssh-tab')
-rwxr-xr-xhosts/ssh-tab24
1 files changed, 24 insertions, 0 deletions
diff --git a/hosts/ssh-tab b/hosts/ssh-tab
new file mode 100755
index 0000000..8e8a310
--- /dev/null
+++ b/hosts/ssh-tab
@@ -0,0 +1,24 @@
+#!/bin/bash
+# ssh-tab - ssh to an alias in a tab of the running kitty
+# Copyright (C) 2026 Danilo M. <danix@danix.xyz>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# Lifted from blackpearl-sshmenu.sh, the rofi menu this shell replaces.
+# 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.
+name=${1:?usage: ssh-tab <alias>}
+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 kitty ssh "$name"