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
done
}
The first argument is the screen session name. The second, optional, argument is the time spent on each screen window.