Updated: July 29th, 2021
Introduction
Screen is awesome. Once you become comfortable navigating around it, you start using it ALL the time. No more dropped sessions, no having 10 Putty windows open at the same time, no more nohup.
However, with default screen settings I've always felt a bit lost and out of place, mostly because there was no "taskbar" with a bird's eye view of all windows. Pressing ctrl-a, " really does get annoying fast (that's the command that brings up the window selector – screenshot below).
So instead I modded my screen to have a "taskbar" which sits at the bottom of screen and adds:
- the name of each window
- a clear marking of window states, such as
- the currently active window (* and different background)
- last used window (-)
- if you're sharing the current window with someone else (&)
- the current incoming/outgoing bandwidth in bytes/sec, updating every 5 seconds
- the current time
- the load on the server, as reported by the uptime or w commands
Of course, all of the above is customizable to your liking, but this is what I picked for myself.
Without further ado, here's a screenshot:
Doesn't that make you feel much more homey?
Now using a shared screen session for pair programming, as suggested in a recent article posted on Hacker News, suddenly sounds even more appealing.
Installation
Here's what you need to get this bar on your screen:
- download my .screenrc and put it in your home directory. Make sure the location of wormulon (installed in the next step) is correct. Also, specify the right network interface (eth0 in most cases).
Here is the file, for reference:
1 2 3 4 5 6 7 8 9 10 11 | # Monitor eth0 bandwidth and update every 5 s # Assign the output of this cmd to '%1`' and use it in the below hardstatus line: backtick 1 0 0 /usr/local/bin/wormulon -d 5 -i eth0 hardstatus alwayslastline "%{bw}[%H] [%?%-Lw%?%{wb}%n*%f %t%{bw}%?%+Lw%?]%=%{bw} [%1`] [%c:%s] [%l]" # modified from http://lists.gnu.org/archive/html/screen-users/2007-08/msg00008.html # Set the scrollback length: defscrollback 10000 # Select whether you want to see the copyright notice during startup: startup_message off |
- download and compile wormulon (wormulon-0.1.4.tar.gz) – a nifty little program that shows incoming and outgoing bandwidth and is perfect for integrating with screen. You can omit this step if you don't want the bandwidth monitor. I know the name is a bit odd but it's a legit little open source utility – feel free to check out the code.
tar xvzf wormulon-0.1.4.tar.gz cd wormulon-0.1.4/ ./configure && make sudo make install # this installs into /usr/local/bin/; # alternatively, copy the wormulon binary wherever you # want and update the path in .screenrc |
Now restart screen and you're good to go.
In the meantime, if you found this article useful, feel free to buy me a cup of coffee below.