From dd0cc2f5e1aa9ff14f56b530c3aec28524e4fc38 Mon Sep 17 00:00:00 2001 From: Jack Jackson Date: Wed, 20 Jul 2022 07:14:54 -0700 Subject: [PATCH] Edit to ssh-to-idle entry --- blog/content/posts/ssh-to-idle-screen-window.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/blog/content/posts/ssh-to-idle-screen-window.md b/blog/content/posts/ssh-to-idle-screen-window.md index bc0f2c0..b7f66fc 100644 --- a/blog/content/posts/ssh-to-idle-screen-window.md +++ b/blog/content/posts/ssh-to-idle-screen-window.md @@ -31,7 +31,7 @@ Translated into shell code, that looks like: Host host_nickname HostName hostname.avril RequestTTY force - RemoteCommand sessionName=main; sessionSocket=$(ls /run/screen/S-pi | grep -E "^[[:digit:]]+\.$sessionName$"); if [ -z "$sessionSocket" ]; then screen -S "$sessionName"; else idleWindows=$(pgrep -P $(echo "$sessionSocket" | cut -d "." -f1) | xargs -I {} sh -c "echo -n '{}:'; pgrep -P {} | tr '\n' ':'; echo" | grep -E -v ':[[:digit:]]' | sed -n 's/:$//p'); if [ -z "$idleWindows" ]; then screen -D -RR -S "$sessionName" -p +; else screen -D -RR -S "$sessionName" -p $(tr '\0' '\n'