Wednesday, June 20, 2007

system activity window

in kde3 pressing ctrl-esc would pop up ksysguard with the process table. useful feature, but with three things that could be made better:
  • speed: opening a whole new app can be slow, especially when the system is under unusual load which is often exactly when you want it
  • user interface: since it was the whole ksysguard app there were menubars and tabs and all sorts of clutter
  • discoverability: ah, ctrl-escape.. how many found that little gem? not nearly enough


so at last year's akademy john tapsell, who had taken ksysguard under his rather capable wings, and i chatted about the situation. we charted a cunning plan to fix all three of these issues. ok, maybe "cunning" is a bit of an overstatement. well, you be the judge.

to fix the speed issue, we decided to put the process table into krunner. this would make it faster to bring up because krunner would already be running. this meant getting the widgets into a library for external usage, which john came through on. now when you press ctrl-esc it appears instantly, even the first time, and better yet it is populated with information before you can blink. the kde3 sysguard takes a couple of seconds with no load to populate the window after the app has started up. this is such an improvement it's not even funny, and the credit for this goes almost exclusively to john's efforts (though qt4's model/view stuff probably helped out =)

and now that these widgets are all in a library, here's one for your inner geek: you can start Qt designer and pop a process listing on a form and interact with processes, live, from inside designer. not talking about doing a preview of the form, but right there when it is in edit mode. talk about sickeningly cool.

with speed addressed, what about user interface? since the table was going to be hosted by krunner, we could make the user interface quite slim. here is where it was at earlier today:



the buttons are a bit odd and the window title are wrong in the screenshot, but you get the idea. we're also adding an expander arrow that will grow the window to show some basic stats below the table (cpu, memory, etc). but notice the lack of a menu bar, tabs, etc.. and once the buttons are all squared away it'll be pretty nice.

think of it as a ksysguard-superlite-in-a-window. 100% of the code is shared with ksysguard; in fact, if you launch ksyguard it will share the library =)

this leads us to the solution for the discoverability problem. we are putting a button in the run dialog to get to your system activity monitor:



this shot is pretty bad, but it works (the important bit) and the oxygen team are currently nearly finished with the rework of the krunner ui so i figured i wouldn't bother trying to make it pretty in its current form. the important thing is that it's pretty easy to see how to pull up a system monitor now when you go to the run dialog.

ctrl-esc is still there and we may offer a link in the application launcher interface (the successor of the application menu) though that is still yet to be decided on for sure.

speaking of krunner's interface: i just got the final draft artwork by email late yesterday ... it's hot! =) there was also a bunch of work done on various bits of plasma, but this was more exciting. well, for me at least =)

yep ... today was one more baby step towards total desktop world domination. kde4: be free. boo yah! =)

22 comments:

Anonymous said...

kde4tehwin! :D

Anonymous said...

Ctrl+esc isn't so obscure for those of us who grew up on OS/2 and used that key combo to bring up the window list.

(Granted, unobscure due to familiarity with something obscure is still obscure)

Anonymous said...

Hello aaron, what you say is great!

I like the way you and all the kde devs see and change things:
1- what was wrong or can be improve
2- what can be done to resolve it
3- resolve it

Nice!

Anonymous said...

Hi Aaron,

I haven't been able to play with KDE4 for a few weeks, alas, but I'm wondering how the performance issues with ksysguard are nowadays? Using it a few weeks back was kind of pointless, as the biggest consumer of CPU was always ksysguard itself (Heisenberg must be rolling in his grave ;))

If there are no ksysguard instances open (including the sysguard-superlite-in-a-window) does ksysguard still query the CPU usage of all apps every few seconds, or is it dormant?

Cheers =)

Aaron J. Seigo said...

@anonymous: "If there are no ksysguard instances open (including the sysguard-superlite-in-a-window) does ksysguard still query the CPU usage of all apps every few seconds, or is it dormant?"

at least here, when the system activity window isn't shown there's no cpu usage. when shown it takes 2-4% of cpu time on the athlon 3200 here. i don't know how much of that is drawing the table, gathering stats or maintaining the data model, as i haven't done or seen any measurements on that yet

Anonymous said...

Please make it possible to deactivate ctrl-esc shortcut, I use ctrl-Fx keys to switch desktops and I often accidentally press ctrl-esc which opens ksysguard.

Anonymous said...

Oh my beloved krunner is getting nicer and nicer. :)

Aaron, is there a collaboration between katapult and krunner devs?

I just wonder because both share core features but differ here and there. So far I prefere katapult for fast starting of apps (sometimes music) because in most cases it knows what I need or at least suggests and completes it (actually I use krunner for stuff like gg:something, "StartMeAsRootApps", "NiceMe" and apps not found by katapult).

josepfebrer said...

Great work Aaron.

What I want to ask you if KDE line edit bars will only show the clear button only when there is text inside, as you can see from:

http://labs.trolltech.com/blogs/2007/06/06/lineedit-with-a-clear-button/

Thanks for your work,

Josep

cies said...

does this mean krunner is separately themed from all other kde apps?

shouldn't both krunner and ksysguard be implemented in plasma then? possibly making them themeable.

the data sources that krunner and ksysguard need (information about runnable programs, openable files -and- processes, load, etc) can also be usefull for other plasmoids.

krunner be placed on the panel/backgound or just used as a popup.


maybe i'm saying something strange here. in that case sorry.

_C.

David said...

Hey Aaron, is system monitor going to be shown within or outside krunner (a.k.a launcher :p) ?

physos said...

Hey Aaron, I wonder about adding a summary on that sysguard light. Ginving a chance to see the overall CPU and Memory usage.

like:

CPU 50%
Memory 40%
Swap 0%

Guess a nice little bar to have a graphical indicator would eat too much CPU again.

CPU ###50%...
Memory ##.40%...
Swap ....0%...

ASCII art is great :)

mattie said...

you can't imagine how happy I am with these improvements! :) more than once I was quite annoyed by the slugginess and userunfriendliness of ksysguard..

I wish there also comes a time that kde comes with some exhaustive/advanced monitoring tools for expert users; like windows users have the tools from sysinternals (my favorites: processexplorer & tcpview)

Anonymous said...

Well, its a nice feature for people, who care about the load of their computer. This means this is a feature mostly for developers or advanced users, thats why you should rethink the quite tight integration in krunner and the system at all.
Why do we need a button in krunner for this? I do not run ksysguard every two minutes, do you?
So I think typing its name would be enough!

Don't understand me wrong, you do a great job, but you may keep in mind, that not only developers will use kde4!

Troy Unrau said...

@cies

Krunner already uses some of the plasma theming calls, but runs in it's own process separate from plasma.

For a good reason too - Krunner isn't just a Run Dialog - it also handles things like screen locking, the mini-ksysguard, etc. that are absolutely required to work right every time, and cannot risk being brought down by some bug in plasma triggered by some weird combinations of plasmoids. Imagine plasma crashing, and then trying to hit ALT-F2 so you can restart it, only to find out that the run dialog is gone. Or imaging plasma crashing while the screen is about to lock, leaving your workstation logged in and unprotected overnight at work. Etc.

So, there's a good reason for it to live in it's own process.

Hope that clears things up for you :)

Aaron J. Seigo said...

@anonymous: "Please make it possible to deactivate ctrl-esc shortcut,"

you already can in both kde3 and kde4. it's in the keyboard shortcuts control panel and called "Show Taskmanager"

@anonymous: "Aaron, is there a collaboration between katapult and krunner devs?"

we've talked. hopefully we'll share the runners themselves (and therefore sources of matches / data)

"I just wonder because both share core features but differ here and there. So far I prefere katapult for fast starting of apps (sometimes music) because in most cases it knows what I need or at least suggests and completes it"

the only reason krunner doesn't provide matches as nicely as katapult is that many of the runners are not complete. krunner should perform even better than katapult currently does; if we end up sharing runners then we should offer very similar results though in different form factors.

@josepfebrer: "What I want to ask you if KDE line edit bars will only show the clear button only when there is text inside"

right now they don't. it would be easy to make them behave that way. i'm really not sure which way is best.

@cies: "does this mean krunner is separately themed from all other kde apps?"

yes and no. it uses the qstyle for all the widgets, but it also uses elements from Plasma::Theme, such as for the background.

"shouldn't both krunner and ksysguard be implemented in plasma then? possibly making them themeable."

they already are themable and share that system with plasma, among other things. however, implementing them in plasma would be, imho, a poor choice. it's important that the services krunner provides are always available and quick to get at, which is hard to guarantee if they were part of a larger app such as plasma.

"the data sources that krunner and ksysguard need (information about runnable programs, openable files -and- processes, load, etc) can also be usefull for other plasmoids."

AbstractRunner, which is the base class for and loader of the plugins that popular krunner's data pool, is already in libplasma. the information from sysguard, along with many others (e.g. solid), will be exposed via dataengines. these are already being written.

"krunner be placed on the panel/backgound or just used as a popup."

it already is just a popup and accessing runners from a plasmoid is not a problem.

remember, though, that krunner does a lot more than just run apps. it's also screen saver services, screen locking, start up notification management, etc..

@David: "Hey Aaron, is system monitor going to be shown within or outside krunner (a.k.a launcher :p) ?"

there will still be a separate and full feature ksysguard, but the quick-access process table is in-process to krunner though it shows in its own window.

@physos: "I wonder about adding a summary on that sysguard light."

i actually covered this in the blog entry: 'expander arrow that will grow the window to show some basic stats below the table (cpu, memory, etc)'

"ASCII art is great :)"

hehe.. agreed ;)

@mattie: "I wish there also comes a time that kde comes with some exhaustive/advanced monitoring tools for expert users"

what you are looking for is already there and it's called ksysguard. it can even do all that monitoring and reporting on multiple remote machines simultaneously.

@nonymous: "This means this is a feature mostly for developers or advanced users,"

no, it's a feature for people who need to see why their system is running so slow and stop that unruly process that is spinning away taking 99% of the cpu. there is a real reason why every mainstream desktop provides access to this information, and it isn't to pander to developers or advanced users.

"thats why you should rethink the quite tight integration in krunner and the system at all."

actually, having it tightly integrated is the only way to make it responsive enough to make it useful in the one use case that non-developers/advanced users use it for.

"Why do we need a button in krunner for this?"

i covered this in the blog entry: discoverability. kde users routinely ask for how to get to this information because they can't find it but need/want to get to it.

in the final krunner interface it'll much more discreet of a link/button, which i also covered in the blog entry. i even said the krunner shot was pretty horrid but that i didn't spend time prettying it up because we're rearranging the whole thing right now anyways.

"I do not run ksysguard every two minutes, do you? So I think typing its name would be enough!"

you are missing the use case for the process table: your system is under unusual load and you need to get at a process listing to find the offending process and stop it. it has nothing to do with running ksysguard every two minutes, it's about getting to an emergency service fast.

ever notice how public buildings have those geeky little fire alarm levers everywhere? its not like you pull those every 2 minutes either. in fact, you've probably never pulled one (esp to announce a real fire ;). but when they are pulled to alert people and the firefighters to a situation, they save lives.

same concept.

"Don't understand me wrong, you do a great job, but you may keep in mind, that not only developers will use kde4!"

keeping in mind that developers aren't the primary users of kde4 is why we're doing this.

developers know ctrl-esc and they don't need ksysguard to type `killall -9 <whatever>`

Aaron J. Seigo said...

@Troy: "Imagine plasma crashing, and then trying to hit ALT-F2 so you can restart it, only to find out that the run dialog is gone. Or imaging plasma crashing while the screen is about to lock, leaving your workstation logged in and unprotected overnight at work. Etc."

exactly.

now imagine running kde3, where that is exactly what happens if kdesktop crashes =) it is even "worse" with plasma as we're also taking in the functionality of kicker, superkaramba, etc. but splitting krunner out completely was actually inspired by exactly the kinds of events you describe here happening with kdesktop ...

Leo S said...

@aseigo
"if we end up sharing runners then we should offer very similar results though in different form factors."

As far as I'm concerned, there isn't any reason why krunner wouldn't do everything that katapult currently does (as well as a lot more). On the scale of "text based launchers", katapult is fairly primitive (compared to Launchy or Quicksilver), and krunner has the potential to surpass them all while still being fast (as opposed to something like a desktop search engine, which does the same thing but is quite slow because it can't prioritize different classes of matches).


"right now they don't. it would be easy to make them behave that way. i'm really not sure which way is best."

I'd only display them when clicking them has any effect. Having a clear button on an empty line edit serves no purpose, and just adds screen clutter in that case.

illissius said...

Yes! I think this is one of the few bugs in the zilla I have votes on. <3

Is there any way to make sure krunner is also never swapped out? A lot of times, "heavy load" means swap hell, so even if the app is already "running", if it's not in physical memory, it'll still take an eternity before it reacts.

Anonymous said...

illissius,

It's something that I've discussed back and forth - whether to lock krunner etc into memory. In the end.. the answer is not really. It's just not feasible - it would mean locking into memory all of Qt, KDE libs, and lots of other stuff.


Someone mentioned about performance.. yeah Qt 4.2 was pretty slow at drawing the QTreeView. I'm sure I'll get the bugs ironed out though.

It doesn't update if it's not visible. That includes being on a different desktop etc.

- John Tapsell

Anonymous said...

@nonymous: "This means this is a feature mostly for developers or advanced users,"

Aseigo: no, it's a feature for people who need to see why their system is running so slow and stop that unruly process that is spinning away taking 99% of the cpu. there is a real reason why every mainstream desktop provides access to this information, and it isn't to pander to developers or advanced users.

I agree with both of these opinions, and think there could be a comprimize.

Rather having a "Show System Activity" button it could simplifed to "Force Quit...". Clicking on the button would only show user apps (eg. Koffice, Kruiser). with their system usage percentages. If one of the apps has died, or taking a heavy CPU load then the stats could replaced with a highlighted message like "Not Responing" or "Using Heavy CPU Resouces" to direct users.

In that diplay mode the button could say "Force Quit", which I think is more clear than "Kill Process". Next to the "Force Quit" would be "Show all Processes" button which would display everything.

This is an extra mouse click, but I think it would save users the time of scrolling down a list. Also in the complete process view some type of color coding based on process type could be helpful.

Anonymous said...

@aseigo: "no, it's a feature for people who need to see why their system is running so slow and stop that unruly process that is spinning away taking 99% of the cpu. there is a real reason why every mainstream desktop provides access to this information, and it isn't to pander to developers or advanced users."

In such a situation, the last thing the user will do is open the run dialog in order to find the "Show all processes" button (because you only open the run dialog to run a new application, which is not what you will do if your system is painfully slow). Therefore, I think that you should put that button elsewhere, maybe in the system tray, or in the Start menu in the "Actions" section (in the same place as "Lock session", "Log out", ...).

Anonymous said...

All this talk about where to put the process table button....why not just tie it to Ctrl-Alt-Del... :) *ducks*