Ruby Plasmoid and Qt::Timer (time events)
Sunday, December 18, 2011 8:15:45 PM
However I had a big problem. I lost more than a day to figure out how to use a timer in Ruby in a plasmoid. There are several tutorials and examples out there but all I could find is outdated and not working. Finally, I found a working ruby plasmoid and adapted a solution from it. It is, as everything in Ruby, more simple than anyone would expect. So, here it is.
In your 'def init' write this:
@refresh_interval = 10000 start_timer(@refresh_interval)
And than define a timer event:
def timerEvent(event) # your code to be run every @refresh_interval miliseconds end
My plasmoid can be found on kde-look: