Command Output

Plasma 5 Add-Ons

Source (link to git-repo or to original if based on someone elses unmodified work): https://github.com/Zren/plasma-applet-commandoutput

7
Score 81.7%
Description:

Simple widget to print output of a command run every __ seconds.

* Newlines are striped.
* You can also specify commands to run on click or scrolling up/down.

You might be interested in a more advanced widget called Kargos (https://store.kde.org/p/1173112/) which has a specific syntax for rendering the command's output as buttons/text in a popup.
Last changelog:

v8 - February 20 2019 4 months ago

* Fix click + mousewheel commands no longer serializing (Issue #6)

husimo

27 days ago

Also, is there a way to change the text color ? When you remove the background, you better have a dark wallpaper ;-)

Report

husimo

27 days ago

Hello, that's good ! I'm using it to echo random quotes. Would it be possible to disable the ability of the plasmoid to automatically extends itself in width ? Some quotes are larger than my screen and then they are not displayed properly. Would be good to have a "width/height" parameter in options. Thanks ! :-)

Report

x-varlesh-x

1 month ago

10 10 the best

Report

waces

1 month ago

9 9 excellent

Report

waces

2 months ago

Why not letting use less than a second like 500ms?

Report

C

Zren

2 months ago

None really. I misinterpreted Plasma's executeable dataengine and assumed a command couldn't finish faster than 1 second, but I was wrong. I never really had a need to remove the limit before. What use case requires 120 calls per minute?

You're free to edit main.qml and ConfigGeneral.qml to remove the limits on the interval.
~/.local/share/plasma/plasmoids/com.github.zren.commandoutput/contents/ui/

Test with the command "date +%S.%N" and running:
plasmawindowed com.github.zren.commandoutput

Report

waces

1 month ago

Alright, thanks. Just wanted to try making a custom desktop/workspace switcher script thing and the 1s between each time it updates what's showing makes it look kinda laggy :P

I still have some other stuff to try tho

Again, thanks

Report

alex1701c

3 months ago

9 +

Report

alex1701c

3 months ago

I really like it, I had a little bit of trouble with line-breaks but now it works fine

Report

smxms

3 months ago

9 +

Report

Bugworm

3 months ago

9 +

Report

jtaillon

5 months ago

9 +

Report

jtaillon

5 months ago

This is a great little plasmoid. Question: I can use HTML in my command output to create a link (the text turns blue as it is recognized as a link, but I cannot click on that link to open it in a browser. Do you know if it would be possible to do that?

Report

C

Zren

5 months ago

Oops, that won't work. The MouseArea will "eat" the mouse click, so the "Text" won't receive the click event. I tried the "teach a man to fish he eats for a lifetime" philosophy here, but this wasn't the perfect feature for introducing someone to coding widgets.

I'll release v7 in a few hours with these patches:

* https://github.com/Zren/plasma-applet-commandoutput/commit/ecb59ab001f536aad750258cecbf1ed75bc0e895
* https://github.com/Zren/plasma-applet-commandoutput/commit/f9b9385b783567ab2a686a6b49bde680022574bc

Report

C

Zren

5 months ago

Ah, I didn't consider people using link tags. QML Text will automatically switch to RichText mode, but you need to add 1 line of code to make it open the link in a browser (or do something else).

Open up ~/.local/share/plasma/plasmoids/com.github.zren.commandoutput/contents/ui/
Edit the main.qml to add:

onLinkActivated: Qt.openUrlExternally(link)

To the Text element, like in the LinkText.qml from another widget linked below.

* https://doc.qt.io/qt-5/qml-qtquick-text.html#textFormat-prop
* https://github.com/Zren/plasma-applet-phabricatorrevisions/blob/master/package/contents/ui/lib/LinkText.qml#L7
* https://github.com/Zren/plasma-applet-commandoutput/blob/master/package/contents/ui/main.qml#L97

You'll need to restart plasmashell to reload the widget in your desktop/panel though. Easiest way is to relog, but you can also run:

killall plasmashell; kstart5 plasmashell

Report

mockroot

6 months ago

9 +

Report

MOD

intika

8 months ago

9 +

Report

pierat

11 months ago

Nice, small. and very useful! :) One request, though: could you make the alignment of the output optional? (Left, center, right).

Report

C

Zren

5 months ago

Added to v6

Report

marozsas

1 year ago

There is no output on Kubuntu 18.04. Just a plain dark grey window even with the provided test example. Missing dependecies ?

Report

C

Zren

1 year ago

v5 should fix use as a desktop widget.

Report

marozsas

1 year ago

Thank you. Yes, it works now. For the purpose I need, the stripped newlines is a problem, as the multi-line output get garbled. I think that echoing the output "as-is" you can reach a broad range of users, as it simple to remove newlines by putting a pipe to tr '\n' '' but it is impossible to put it back afterwards. Leave the formatting to the user ! Anyway, thank you !

Report

marozsas

1 year ago

Well, I managed to do that. Just removed the "replace('\n', ' ').trim()" . The affected line is now just the bare output of the command execution: "widget.outputText = stdout".
cheers,

Report

bktan81

1 month ago

or there is a better way without modifying the source code. by adding "echo '' && your-command"

Report

C

Zren

1 year ago

It works with the Kubuntu 18.04 LiveCD. https://streamable.com/8wb4n
Or... wait you're using it as a desktop widget? Hmmm. Yeah that's a bug.

Report

v8 - February 20 2019 4 months ago

* Fix click + mousewheel commands no longer serializing (Issue #6)

v7 - February 13 2019 5 months ago

* Added Dutch translation by @Vistaus (Pull Request #10)
* Added support opening html links `<a href="">Link</a>` in your web browser.

v6 - February 9 2019 5 months ago

* Fix boldness not persisting.
* Add ability to center/right align output, italicize and underline.
* Add ability to hide background when used as a desktop widget.
* Fix selecting the default font after changing to another font.
* Add ability to run a command on click / mousewheel (Issue #6)

v5 - May 6 2018 1 year ago

* Support use as a Desktop Widget.
* Add ability to change the font family, size, and boldness.

v4 - March 12 2018 1 year ago

* Run command on load so in case the interval is very long.

v3 - April 5 2017 2 years ago

* Use a lower version of QtQuick.Layouts so that the widget works with Plasma 5.5 (Ubuntu 16.04)

v2 - February 20 2017 2 years ago

* Fix configuring intervals other than 1 second. Thanks @sheerhub
* Use the utilities-terminal icon

12345678910
131
product-maker x-varlesh-x May 24 2019 10 the best
10 the best
product-maker waces May 16 2019 9 excellent
9 excellent
product-maker alex1701c Apr 13 2019 9 excellent
+
product-maker smxms Mar 27 2019 9 excellent
+
product-maker Bugworm Mar 18 2019 9 excellent
+
product-maker jtaillon Feb 13 2019 9 excellent
+
product-maker mockroot Dec 28 2018 9 excellent
+
product-maker intika Oct 19 2018 9 excellent
+
product-maker artos May 13 2018 9 excellent
product-maker thevladsoft May 09 2018 9 excellent
product-maker alex-l Mar 17 2017 9 excellent
product-maker MalteK Feb 19 2017 9 excellent
product-maker nowardev Jan 01 2017 9 excellent
product-maker srog Dec 26 2016 9 excellent
product-maker Count: 4 Rating: 5.0
File (click to download) Version Description Downloads Date Filesize DL OCS-Install
1 Plings
*Needs ocs-url or ocs-store to install things
Details
license
GPLv2 or later
version
8
updated Feb 20 2019
added Dec 26 2016
downloads today
4
page views today 11