I'm building a textmode only linux netbook. I'd like to show information (like battery status) when pressing a hotkey, that would appear on top of whatever running program and disappear in a few seconds, on current virtual console. Is there some utility I could use ? "wall" is not what I mean (must not mess up the screen but be an overlay)
1 Answer
I'm not aware of a utility that will do this. However, you could have a fair stab at implementing your own using the /dev/vcs* devices.
The man page for vcs gives an example program that not only writes to a terminal screen via /dev/vcsN but also sets attributes via /dev/vcsaN.
A trivial demonstration can be seen with the following sample shell code. Note that if the screen scrolls or the top line is updated while the text is displayed, the original content will be replaced at the end of the message display time. (This isn't a true overlay; it's a temporary replacement.)
m="** THIS IS AN IMPORTANT MESSAGE ** " for v in $(seq 7) do d="/dev/vcs$v" if test -c "$d" then dd if="$d" bs=80 count=1 >"/tmp/save.$v" echo -n "$m" >"$d" fi done sleep 5 for v in $(seq 7) do d="/dev/vcs$v" if test -c "$d" -a -f "/tmp/save.$v" then dd of="$d" bs=80 count=1 <"/tmp/save.$v" rm -f "/tmp/save.$v" fi done