From 34d451b8cd6d1fd125b9ba23b3338614927ce266 Mon Sep 17 00:00:00 2001 From: nojhan Date: Wed, 7 Dec 2022 08:19:41 +0100 Subject: [PATCH] use username IP for path links --- dotmatrix.theme | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dotmatrix.theme b/dotmatrix.theme index 23b5212..f181683 100644 --- a/dotmatrix.theme +++ b/dotmatrix.theme @@ -786,8 +786,17 @@ __dotmatrix_activate_hostname() { if _lp_hostname; then case "$lp_connection" in ssh) + local client_ip client_port server_ip server_port hostname= + IFS=" " read -r client_ip client_port server_ip server_port <<<"$SSH_CONNECTION" + local username=${USER:-${USERNAME:-${LOGNAME-}}} + if _lp_create_link "ssh://${username}@${server_ip}:${server_port}" "$lp_hostname"; then + hostname="$link" + else + hostname="$lp_hostname" + fi + # If we want a different color for each host (( LP_ENABLE_SSH_COLORS )) && LP_COLOR_SSH="$LP_COLOR_HOST_HASH" - hostname="${LP_COLOR_SSH}${lp_hostname}" + hostname="${LP_COLOR_SSH}${hostname}" ;; tel) hostname="${lp_hostname}"