TextMon

Plasma 4 Widgets

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

0
Score 63%
Description:

A Do It Yourself textual system monitor, meant to be an entry point for you coding kde plasma applets in JavaScript.

By default it shows:
[li]{cpu: %}{mem: MB}{wlan: KB/s d | KB/s u}{sda: KB/s r | KB/s w}[/li]

You most likely want to tweak the settings right away, like changing the text color to black if your theme is light or monitor eth0 rather than wlan0. This is, of course, done by editing the source code. The settings dialog shows you how to get there. The following page shows a number of examples of how to customize TextMon
[li]http://maikbeckmann.github.com/plasma-textmon/hacking-textmon.html[/li]

To go beyond just tweaking TextMon and gain some insight, take a look at its home page
[li]http://maikbeckmann.github.com/plasma-textmon/[/li]

--------------------

Additional Links
Github repo: http://github.com/MaikBeckmann/plasma-textmon/
Main source file: http://github.com/MaikBeckmann/plasma-textmon/blob/master/textmon/contents/code/main.js

The content of my main.js http://paste.kde.org/425714/ and its diff to main.js in master http://paste.kde.org/425726/. It monitors the same values as the default, but renders them in a shorter way:
%|MB|KB/s d KB/s u|KB/s r KB/s w

--------------------
feedback
@zeltak regarding mpd (updated 2012-02-25): Replace TextMon's main.js with this http://paste.kde.org/428840/ and see if and how it works for you. If you want to make a TextMdpMon copy the TextMon dir to some place (i.e. ~/Projects/TextMpdMon/), replace the main.js with the paste (if you haven't already) and metadata.desktop with http://paste.kde.org/428732/ . See http://maikbeckmann.github.com/plasma-textmon/prelude.html#sec-3 on how to install it.


Last changelog:

7 years ago

- 2012-02-19 So :: 1.0 -- Much better Javascript in main.js

- 2012-02-14 Di :: 0.11 -- Added links to docs and sources to settings dialog.

- 2012-02-09 Do :: 0.1 -- Initial upload.

lionhater

6 years ago

Thanks for the gift, finally a sensible way to see cpu and memory usage instead of absurd graphs.

If the temp reading (lm-sensors) can be added, this would make it the best plasmoid/applet/widget in the the whole cosmos?

But adding mpd track would make it divine! I gather it's possible from above discussion, but can't figure out how.

Report

martinv

6 years ago

Hi MaikB,

thank you very much for this plasmoid. I really missed this in KDE. Hope they could make it an official kde plasmoid one day.
Your KDE/js tutorial is very nice as well.

Report

zeltak

7 years ago

wow thx for this great plasmoid

i wonder if you cann add an option to pipe text from a command line command so i can show the current playing mpd song or other commands?

thx

z

Report

C

MaikB

7 years ago

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.

Report

zeltak

7 years ago

cool
ive been away for a week or so..did you end up implementig this? is there a kde forum post?

so excited about finally getting my mpd info in the kde bar

thx

Z.

Report

zeltak

7 years ago

Whew sorry didnt see the above coments

works reallt well..cant thank you enough for this..basiclly been waiting 3 years for this since kde 4.0 :)

let me know if you need any other testing etc..

thx

Z

Report

jfebrer

7 years ago

I really liked it.

Report

C

MaikB

7 years ago

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.

Report

7 years ago

- 2012-02-19 So :: 1.0 -- Much better Javascript in main.js

- 2012-02-14 Di :: 0.11 -- Added links to docs and sources to settings dialog.

- 2012-02-09 Do :: 0.1 -- Initial upload.

File (click to download) Version Description Downloads Date Filesize DL OCS-Install
Pling
*Needs ocs-url or ocs-store to install things
Details
license
version
1.0
updated Feb 19 2012
added Feb 10 2012
downloads today
0
page views today 1