You are not logged in.
Pages: 1
I just created network monitor shell script for generic monitor, please I need someone to test it. It automatically assign an interface, and also nothing else.
Current issue:
- Can't add a tooltip somehow (I badly wanna add vnstat to tooltip, lol).
- Possible inaccuracy.
Link
Offline
Your code works for me.
To get tooltips to work, you need to echo <tool>tooltip text</tool>. The genmon documentation is located here.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Your code works for me.
To get tooltips to work, you need to echo <tool>tooltip text</tool>. The genmon documentation is located here.
I see, but it sometime shows me 1 MiB/s when I only have 5Mbps wifi. The tooltip is working now, I changes the period to 0.5. I just found that 0.25 prevent tooltip from showing?
Offline
Also, why can't I have something like this:
#!/bin/bash
e=0
while (true);do
e=$(($e+1))
printf "\033c$e"
sleep 0.1
done
Last edited by xfce456 (2020-10-11 19:30:04)
Offline
Also, why can't I have something like this:
#!/bin/bash e=0 while (true);do e=$(($e+1)) printf "\033c$e" sleep 0.1 done
A couple of reasons:
genmon has a built-in timer that acts like a "while(true); do sleep x" loop, where the x is the period. You only need to echo/print the output - don't include a forever loop in the code.
It's not a bash shell so it doesn't process escape codes.
I just found that 0.25 prevent tooltip from showing?
Perhaps its a GTK3 thing where if the tooltip takes longer than the refresh cycle it doesn't display (perpetual state of updating).
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
genmon has a built-in timer that acts like a "while(true); do sleep x" loop, where the x is the period. You only need to echo/print the output - don't include a forever loop in the code.
I guess, this is a ok.
It's not a bash shell so it doesn't process escape codes.
How about clearing the output? Is there a way to do that?
Perhaps its a GTK3 thing where if the tooltip takes longer than the refresh cycle it doesn't display (perpetual state of updating).
I don't really understand about this one . I'll just stick with 0.5 period.
Offline
ToZ wrote:It's not a bash shell so it doesn't process escape codes.
How about clearing the output? Is there a way to do that?
echo ""
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
I think you are mis-understanding the purpose of the genmon plugin. It simply outputs the result of a command. To clear a previous result, it is simply overwritten by the next period execute of the command.
Your first network script does this properly. It outputs the results of your commands. On every iteration of the script (based on the period setting in genmon), it overwrites the previous result with the new result.
With your last script, you are in fact displaying 3 outputs "1", "", and "2" - as is intended by the script and as processed by genmon. From your previous comments I gather you are trying to erase a genmon displayed value and again, genmon doesn't work like that. The previous value will be overwritten (erased) on the next iteration of the script.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Pages: 1
[ Generated in 0.010 seconds, 7 queries executed - Memory usage: 556.77 KiB (Peak: 573.61 KiB) ]