Description: Command Watch is a plasmoid which periodically runs a system command and displays its output. Think of a fortune or your uptime. The possibilities are endless.
Note: this Plasmoid is written for post-4.0.x Plasma versions.Last changelog:
Fix national characters, patch by Radek Novacek; Make it compatible with KDE 4.2.
OK I realize this is an old project but I really love this plasmoid and want to install it on my Fedora 14 box. Unfortunately I can't figure out what to do with the tarball provided and the rpm I found while searching with Google has a dependency of kdebase4-runtime < 4.2.60. I'm on 4.5.5. I've dl'd the src.rpm to try and reconfigure it but I don't know what I'm doing. Please is there a way for me to install this? It worked fine a few months ago on my Fedora 13 box.
Due to tighter integration of Plasma with KDE, some changes to the CMakeLists.txt file are needed to compile successfully.
1) Delete the line: find_package(Plasma REQUIRED)
2) Replace ${PLASMA_LIBS} with ${KDE4_PLASMA_LIBS}
Yes. For my other applet, Flickr On Plasma, I made the following patch againt CMakeLists.txt, which keeps compatibility with <4.2 and >=4.2. This should work the same for this applet.
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,7 +3,12 @@ project(plasma-flickrop)
# Find the required Libaries
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
-find_package(Plasma REQUIRED)
+
+if ( ${KDE_VERSION} VERSION_LESS "4.1.90" )
+ find_package(Plasma REQUIRED)
+else ( ${KDE_VERSION} VERSION_LESS "4.1.90" )
+ set( PLASMA_LIBS ${KDE4_PLASMA_LIBS} )
+endif ( ${KDE_VERSION} VERSION_LESS "4.1.90" )
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
include_directories(
Your pach, included in this version of the plasmoid I just downloaded returns errors on KDE 4.1.3
The if statement looks buggy. After I removed it, it compiles ok.
This is the error:
-- Found automoc4: /usr/bin/automoc4
CMake Error at CMakeLists.txt:6 (if):
if had incorrect arguments: ${KDE_VERSION} VERSION_LESS "4.1.90" (Unknown
arguments specified).
-- Found Plasma: /usr/lib/libplasma.so
CMake Error at CMakeLists.txt:8 (else):
else An ELSE command was found outside of a proper IF ENDIF structure. Or
its arguments did not match the opening IF command.
CMake Error at CMakeLists.txt:10 (endif):
endif An ENDIF command was found outside of a proper IF ENDIF structure.
Or its arguments did not match the opening IF command.
-- Configuring done
This program is excellent! It makes a light weight system monitor with top or with the python script Extraallt.
Extraallt prints the output from specified commands to a text file. Per default it prints the output from hddtemp, lm-sensors and /proc/cpuinfo. Just use it with Command watch and "cat textfile" and set it to update every 3 second.
http://www.cli-apps.org/content/show.php?content=96157
Command watch needs the UTF-patch to print degree symbols, described in the post above by user radnnn
Awk gurus can probably make it print anything.
Note: To build successfully on Kubuntu 8.10, the additional packages need to be installed first.
build-essential, cmake, kdelibs5-dev, libplasma-dev
Tip: I suggest installing the "apt-file" program. When cmake complains that it can't find the file such-and-such, use "apt-file search such-and-such" to find the package with the needed file.
Thanks so much for putting this together; it's almost perfect. I'm wondering how difficult it would be to add a scrollbar to the output display? I'd like to fit about 20 of these in my dashbar, heh...
Thanks again.
Thank you very much for such a versatile widget! It took some twiddling, but I've figured out how to make a "top" plasmoid from this.
Refresh every: 5 seconds
Font: Monospace 9
Command: Quote:
top -b | head -17 | tail -11 | awk '$9!=0 {printf("%5s %4s %s\n",$1,$9,$12)}'
top -b | head -17 | tail -11 gets the top 10 processes using the most CPU. The awk command filters out processes with 0% CPU, and cuts down the displayed information to just the process name, PID, and %CPU.
Small update of your command:
top -n 1 -b | head -17 | tail -11 | awk '$9!=0 {printf("%5s %4s %5s %s\n",$1,$9,$6,$12)}'
will be a bit better.
* -n option for top is added;
* memory usage information is added;
It's faster and for me - previous variant simply doesn't work, because it's hold output (symptom - screen is not updated).
Thank you very much for such a versatile widget! It took some twiddling, but I've figured out how to make a "top" plasmoid from this.
Refresh every: 5 seconds
Font: Monospace 9
Command: Quote:
top -b | head -17 | tail -11 | awk '$9!=0 {printf("%5s %4s %s\n",$1,$9,$12)}'
top -b | head -17 | tail -11 gets the top 10 processes using the most CPU. The awk command filters out processes with 0% CPU, and cuts down the displayed information to just the process name, PID, and %CPU.
Ratings & Comments
18 Comments
Really good plasmoid. Works even now on kde-4.9.3
OK I realize this is an old project but I really love this plasmoid and want to install it on my Fedora 14 box. Unfortunately I can't figure out what to do with the tarball provided and the rpm I found while searching with Google has a dependency of kdebase4-runtime < 4.2.60. I'm on 4.5.5. I've dl'd the src.rpm to try and reconfigure it but I don't know what I'm doing. Please is there a way for me to install this? It worked fine a few months ago on my Fedora 13 box.
Good work, very nice, simple and usable. What do You think about implementing text shadow?
Please let us choose a transparent background.
Due to tighter integration of Plasma with KDE, some changes to the CMakeLists.txt file are needed to compile successfully. 1) Delete the line: find_package(Plasma REQUIRED) 2) Replace ${PLASMA_LIBS} with ${KDE4_PLASMA_LIBS}
Yes. For my other applet, Flickr On Plasma, I made the following patch againt CMakeLists.txt, which keeps compatibility with <4.2 and >=4.2. This should work the same for this applet. --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,12 @@ project(plasma-flickrop) # Find the required Libaries find_package(KDE4 REQUIRED) include(KDE4Defaults) -find_package(Plasma REQUIRED) + +if ( ${KDE_VERSION} VERSION_LESS "4.1.90" ) + find_package(Plasma REQUIRED) +else ( ${KDE_VERSION} VERSION_LESS "4.1.90" ) + set( PLASMA_LIBS ${KDE4_PLASMA_LIBS} ) +endif ( ${KDE_VERSION} VERSION_LESS "4.1.90" ) add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) include_directories(
Your pach, included in this version of the plasmoid I just downloaded returns errors on KDE 4.1.3 The if statement looks buggy. After I removed it, it compiles ok. This is the error: -- Found automoc4: /usr/bin/automoc4 CMake Error at CMakeLists.txt:6 (if): if had incorrect arguments: ${KDE_VERSION} VERSION_LESS "4.1.90" (Unknown arguments specified). -- Found Plasma: /usr/lib/libplasma.so CMake Error at CMakeLists.txt:8 (else): else An ELSE command was found outside of a proper IF ENDIF structure. Or its arguments did not match the opening IF command. CMake Error at CMakeLists.txt:10 (endif): endif An ENDIF command was found outside of a proper IF ENDIF structure. Or its arguments did not match the opening IF command. -- Configuring done
Strange, it works fine here, and the same checks work for my other plasmoid somewhere else. What is your CMake version? Mine is version 2.6-patch 2.
This program is excellent! It makes a light weight system monitor with top or with the python script Extraallt. Extraallt prints the output from specified commands to a text file. Per default it prints the output from hddtemp, lm-sensors and /proc/cpuinfo. Just use it with Command watch and "cat textfile" and set it to update every 3 second. http://www.cli-apps.org/content/show.php?content=96157 Command watch needs the UTF-patch to print degree symbols, described in the post above by user radnnn Awk gurus can probably make it print anything.
Note: To build successfully on Kubuntu 8.10, the additional packages need to be installed first. build-essential, cmake, kdelibs5-dev, libplasma-dev Tip: I suggest installing the "apt-file" program. When cmake complains that it can't find the file such-and-such, use "apt-file search such-and-such" to find the package with the needed file.
Here is the fix for national characters: replace line 216: Quote:m_output = m_proc.readAllStandardOutput();
with
Quote:m_output = QString::fromUtf8(m_proc.readAllStandardOutput());
It should work for at least UTF-8 locales...
Ebuid is here - http://sonylaptoptools.sourceforge.net/ebuilds/plasma-commandwatch-0.1.ebuild
Thanks so much for putting this together; it's almost perfect. I'm wondering how difficult it would be to add a scrollbar to the output display? I'd like to fit about 20 of these in my dashbar, heh... Thanks again.
Thank you very much for such a versatile widget! It took some twiddling, but I've figured out how to make a "top" plasmoid from this. Refresh every: 5 seconds Font: Monospace 9 Command: Quote:top -b | head -17 | tail -11 | awk '$9!=0 {printf("%5s %4s %s\n",$1,$9,$12)}'
top -b | head -17 | tail -11 gets the top 10 processes using the most CPU. The awk command filters out processes with 0% CPU, and cuts down the displayed information to just the process name, PID, and %CPU.
Small update of your command: top -n 1 -b | head -17 | tail -11 | awk '$9!=0 {printf("%5s %4s %5s %s\n",$1,$9,$6,$12)}' will be a bit better. * -n option for top is added; * memory usage information is added; It's faster and for me - previous variant simply doesn't work, because it's hold output (symptom - screen is not updated).
darn refresh. sry for the double post!
Thank you very much for such a versatile widget! It took some twiddling, but I've figured out how to make a "top" plasmoid from this. Refresh every: 5 seconds Font: Monospace 9 Command: Quote:top -b | head -17 | tail -11 | awk '$9!=0 {printf("%5s %4s %s\n",$1,$9,$12)}'
top -b | head -17 | tail -11 gets the top 10 processes using the most CPU. The awk command filters out processes with 0% CPU, and cuts down the displayed information to just the process name, PID, and %CPU.
i add you plasmoid on my debian repo deb http://www.amarok2deb.co.cc/debian/ unstable main