From 13c007e097409a9545da0f6b7c191eab06c1c99d Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 15 Sep 2014 16:51:05 -0400 Subject: start working on providing more information in the watcher screen --- ssh.py | 17 +++++++++++++++-- termcast.py | 3 +++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ssh.py b/ssh.py index 868a708..1bcb6d5 100644 --- a/ssh.py +++ b/ssh.py @@ -77,9 +77,22 @@ class Connection(object): def _display_streamer_screen(self, streamers): self.chan.send("\033[2J\033[HWelcome to Termcast!") - row = 3 + self.chan.send( + "\033[3H %-20s %-15s %-15s" % ( + "User", "Terminal size", "Idle time", + ) + ) + row = 4 for streamer in streamers: - self.chan.send("\033[%dH%s) %s" % (row, streamer["key"], streamer["name"].decode('utf-8'))) + key = streamer["key"] + name = streamer["name"].decode('utf-8') + size = "(%dx%d)" % (streamer["cols"], streamer["rows"]) + idle = streamer["idle"] + self.chan.send( + "\033[%dH%s) %-20s %-15s %-15s" % ( + row, key, name, size, idle + ) + ) row += 1 self.chan.send("\033[%dHChoose a stream: " % (row + 1)) diff --git a/termcast.py b/termcast.py index ca8d213..2750869 100644 --- a/termcast.py +++ b/termcast.py @@ -93,4 +93,7 @@ class Connection(object): return { "name": self.name, "id": self.connection_id, + "rows": self.handler.rows, + "cols": self.handler.cols, + "idle": "0s", # XXX } -- cgit v1.2.3-54-g00ecf