############################################################################## # an-comms.pl # 30 minute Tk::hack to enumerate aironet signal quality in a graphical way # At best a solid example on how to monkey with Tk::ProgressBar # Uses some stuff, ancontrol, Tk (do the perl -MCPAN -e shell shuffle) # Ron Sweeney , 11/2K02 ############################################################################## use Tk::ProgressBar; use Tk; $MW = MainWindow->new; $MW->bind('' => \&exit); $MW->bind('' => \&exit); $label= $MW->Label(-text => 'Signal Quality'); $progress = $MW->ProgressBar( -width => 50, -length => 200, -anchor => 'w', -from => 0, -to => 100, -blocks => 1, -colors => [0, 'red', 25, 'yellow', 50, 'green'], -variable => \$position ); $label->pack; $progress->pack; $progress->repeat(100, sub { $position = `ancontrol -S | grep strength | tr -d \'\\045\' | awk \'\{ print \$4\}\'` }); MainLoop;