I don't think you'll be able to do this with
screen unless the output is actually rendered in a window, which probably defeats the point of using screen.
However, the window does not have to be in the foreground.
The ImageMagick suite contains a utility called
import you can use for this. If
import --help gives you "command not found", install the imagemagick package, it will be available in any linux distro.
import needs the name of the window.
iftop is a terminal interface, so to make sure you use the right name, you'll have to set the title of the GUI terminal it runs in. How you do that depends on which GUI terminal you use. For example, I prefer the XFCE Terminal, which would be:
Terminal -T Iftop -e iftop
Opens a new terminal running
iftop with the title "Iftop". A screenshot of that can be taken:
import -window Iftop ss.jpg
If you are going to do this every five seconds, you probably want to instead open the window running a script so you can reuse the same terminal:
while ((1)); do
sleep 1 # make sure iftop is up
import -window Iftop iftop_sshot$count.jpg
If the script is "iftopSShot.sh" then you'd start this
Terminal -T Iftop -e iftopSShot.sh -- except you're probably not using
Terminal. Most of the linux GUI terminals are associated with specific DE's, although they are stand-alone applications which can be used independently. I believe the name of the default terminal on KDE is
Konsole and it follows the
-e conventions; for GNOME it is probably
gnome-terminal (this may have changed) and it appears to use
-t and not
import by default rings the bell, which will get irritating, but there is a