From: Michael R. <re...@eu...> - 2006-07-17 15:54:55
|
Hi Benjamin, > I have an icon to indicate whether my PPP connection is up or not. I'd also > like to regulate the speed of the icon. In my lcd4linux.conf, I have: > > Widget PPPSpeed { > class 'Timer' > expression pppspeed = (1/((netdev('ppp0', 'Rx_bytes', 1000) + > netdev('ppp0', 'Rx_bytes', 1000))/99999)) > update 100 > } > > > Widget Arrow { > class 'Icon' > speed pppspeed > visible exec('/sbin/ifconfig | grep ppp | wc -l', 1000) > Bitmap { > Row1 '...' > } > } > ...But this doesn't work. How should I be doing this? Is it even possible? Hmmm... Took me some time to understand what you're doing, but I think I got it now: pppspeed is a variable... I just checked the code: the 'speed' attribute of the icon widget is evaluated on every call. So it *should* work... You could try to use the variable in another test widget, formatted as a number, just to check if it's evaluated correctly. another idea: the icon widget adds one-shot-timers itself, but only if speed > 0 (speed = 0 means a static icon, which never changes). So as soon as your pppspeed variable is zero, speed will be no longer evaluated. And I'm afraid it *will* be zero, namely on the first call. So you should prevent it from becoming zero, either by specifying speed pppspeed+1 or even better speed max (1, pppspeed) (maybe replace 1 by a better value, as 1 would be 1 msec, which is *very* short :-) bye, Michael -- Michael Reinelt <re...@eu...> http://home.pages.at/reinelt GPG-Key 0xDF13BA50 ICQ #288386781 |