I'm trying to making a small monitor to a program called showbf that print an updating itself every a certain amount of time.
my best try is the following
ssh user@server.foo "exit"
if [ $? -ne 0 ]
then
ssh-add < /dev/null
fi
while true
do
resources=$(ssh user@server.foo "showbf")
if (echo "$resources" | grep -q "[0-9] procs")
then
echo $(echo "$resources" | awk '/[0-9] procs/ {print $1,"for",$5}')
else
echo "No procs available."
fi
if [[ $? == 0 ]] || [[ $? == 1 ]]
then
exit 0
fi
sleep 1
done | zenity --text-info --height=200 --width=300 \
--title "Resources available for immediate use (showbf)"
I really don't like it because it appends the results to the previews. It becomes really messy. I'd like to use something like zenity --list (the results are 2 colums, num of proc available and walltime). But once zenity reads the data it does not update its contents. Any ideas??
Using while loops to recreate windows is not what I want because the new windows is replaced in the center of the screen.
Many thanks Salvatore