You are not logged in.

#1 2020-05-20 13:57:37

6ftclaud
Member
From: Lithuania
Registered: 2020-05-20
Posts: 2

Adding bash script to panel as a widget

Hello,
I'm a relatively new Linux user (~2-3months), and I couldn't find an answer to this anywhere, maybe I just formulated it wrong.
How do I add this script ( while true; do lscpu | grep MHz; sensors | grep Tdie; sleep 1s; done ) to my panel as a widget?


Kernel version: 5.6.13-arch1-1
DE: KDE plasma, plasmashell 5.18.5

At the moment, I have it added in my .bashrc as an alias but it would be pretty nice to have it in my panel so I could see it at all times.

Last edited by 6ftclaud (2020-05-20 14:09:55)


When I code I just drink Monster and pass out for 8 hours.
Sort of like alcoholism, but less productive.

Offline

#2 2020-05-20 15:25:11

Temet
Member
Registered: 2019-07-08
Posts: 22

Re: Adding bash script to panel as a widget

Hi,

You can add the "command ouput" plasmoid widget to display the output of a shell command in the panel... but I'm not sure it's the best idea (and you'll have to remove your while/do/sleep).
Check if there is not already an existing plasmoid providing the info you need smile

Offline

#3 2020-05-20 15:27:54

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,425

Re: Adding bash script to panel as a widget

To the best of my knowledge you can't just have a output string as a plasma panel widget. Edit: Apparently you can. However there are actual proper system monitoring widgets, can't you use one of those?

Last edited by V1del (2020-05-20 15:30:37)

Offline

#4 2020-05-20 15:43:58

6ftclaud
Member
From: Lithuania
Registered: 2020-05-20
Posts: 2

Re: Adding bash script to panel as a widget

Temet, thanks for the input. I tried it and it works flawlessly! I got 2 of those in my panel with a spacer inbetween running
lscpu | grep MHz | sed 's/ //g' | sed 's/CPUMHz/MHz/g'
sensors | grep Tdie | sed 's/ //g' | sed 's/Tdie/CPU/g'
Result

V1del, could you link the info on how to output strings in a widget (for future reference if I try to do something like that). And to be honest, that marks this thread solved big_smile .

Thank you both very much smile Go linux!

Edit: I tried a couple of those widgets but they're either not exactly what I'm looking for or they're buggy or they do not work (maybe missing some required packages). Plus, I just want to learn how to make one myself. I love building things like this. Got myself a  little terminal app to update and list my google calendar events, just for the heck of it.

Last edited by 6ftclaud (2020-05-20 15:45:59)


When I code I just drink Monster and pass out for 8 hours.
Sort of like alcoholism, but less productive.

Offline

Board footer

Powered by FluxBB