Archive for November, 2008

Rotating GNU Screens

I often have many open screen windows to monitor a machine: “top”, “tail -f …”, “thin …” and so on.

Wouldn’t it be great if you could open a terminal and have these screens rotated automatically?

I wrote this simple shell function: (to include in your .bashrc)

function screen_rotate() {
  local session_name=${1:?"missing session name"}
  local sleep_duration=${2:-5}

  while true; do
    screen -S $session_name -X next
    sleep $sleep_duration

The first argument is the screen session name. The second, optional, argument is the time spent on each screen window.

Read Full Post »