Wednesday, February 17, 2010

System Activity - Detailed Process View Part 1

I've talked about features that made it into KDE SC 4.4, and completed features that are now in svn for KDE SC 4.5. So now here's a more long term feature that I've been working on.

Scripting support for System Activity. We can now write javascript script to fetch and display information about processes.

For example:





The idea is that memory usage is rarely understood. So I wanted a tool that would try to present the information as simply as possible. There's still a lot of work to do with this, and I still haven't sorted out how I want it to work fully. I was thinking of giving it tabs, with each tab presenting different information about the process. For example a tab with graphs of cpu/memory usage over time, and a tab showing the files that the process has open.


At the moment scripts are created by just creating a main.js file and that script outputs html. The trouble with this approach is that it's very difficult for translators to, well, translate the output. So instead I was thinking of doing it like ruby on rails etc, and having a .html file that would look like:

<h1>Process <%= process.pid %> - <%= process.name %></h1>

etc. Hopefully this would be fairly easy to implement, and translators would create a copy of the html file and adjust it how they want.
Does this approach sound like it might work?

5 comments:

ähm... said...

I don't think I fully understand your approach or why you need Javascript to CREATE static html files, but if you look for a templating system like Ruby's then you might want to look at Grantlee for Qt:
http://www.gitorious.org/grantlee/pages/Home

Diederik van der Boor said...

Great idea!

Some thoughts:
* I'd seriously recommend grantlee as well. With KDEPIM alls using it, it can easily become the de-facto string template engine in KDE. ( With a more cleaned up API, I'd love to see it in kdelibs or kdesupport. )
* Second, perhaps a bit less text to read would be nice. This reads like a handbook example. :p

maninalift said...

What is the problem with using traditional i18n functions from within javascript?

Unknown said...

I cannot comment on the implementation, but the idea to expose memory usage and consumption in a "readable" way is fantastic. Go ahead!

Anonymous said...

Oh man, this is absolutely awesome and something really useful! This is something we need! Valued information shown in HUMAN way! And in the process, EDUCATING the users, educating them so they can not be fooled in the future - this is really important.. :-)

I hope you will manage to implement it neatly into the core kde sc interace :)