Image 01
profile-image

MaikB

Maik Beckmann Aachen, Germany
Plasma 4 Widgets
TextMon

Plasma 4 Widgets 8 comments

by MaikB
Score 74.3%
Feb 19 2012
Good thinking there :D

I've looked at what Awesome (the WM) widget's do. They use Lua's io.popen which allows to monitor the stdout of a program asynchronously.

From what I can tell there is no direct equivalent in Plasma's JavaScript API. Instead you're supposed to use the "executable" date engine. It starts a process, waits for it to finish and sends you the stdout,stderr etc. to the slot it was connected it to. You can't monitor a long running process with it, since it won't call the slot until the program has finished execution.

In case of "mpd" this isn't an issue though. It's a daemon that can be queried by short running programs, foremost "mpc". In other cases there is always the workaround to provide a shell script that starts, reads some data and exits.

Since I can't edit comments to fix errors, I'll add the paste link to some code in the description above. I think of a better method to share such snippets later. Maybe a thread on forum.kde.org is a good idea.
- Feb 24 2012
The code of version 0.1 worked well, but looked horrible. That became very clear when I wrote the documentation on how to change/tweak it. Changes all over the place were needed and then this giant "if else if" chain.. *shiver*.

As of version 1.0 I'm really happy with the code and feel confident enough to say: Thank you :D

The real work however was and will be the documentation. If you have any questions or suggestions, feel free to ask them here. - Feb 19 2012
ZeroNome Dark

Plasma Color Schemes
by ElementoCero

Score 75.5%
9   Mar 10 2012
Score 58.6%
9   Feb 23 2012
Yotsuba / 4chan Theme

Kopete Styles
by finkle

Score 67.1%
9   Feb 23 2012
Score 82.9%
9   Feb 23 2012
gmail-plasmoid

Plasma 4 Widgets
by mjmccans

Score 76.9%
9   Feb 14 2012
Kaire

Wallpaper Other
by mcder

Score 70.0%
9   Oct 12 2011
Score 79.1%
9   Sep 29 2011
Androbit

Plasma Themes
by nameless89

Score 77.8%
9   Aug 11 2011
Oxyfied

Yakuake Skins
by lxg

Score 75.5%
9   Aug 02 2011
Linux on Wall (Blue)

Wallpaper Other
by Fri13

Score 62.5%
9   May 03 2011