27
submitted 9 months ago* (last edited 9 months ago) by [email protected] to c/[email protected]

[SOLVED] Hurray! I did it!


Solution: You need to have Generic monitor xfce link installed [available almost on every DE out there]

Two finger Tap on Panel Panel (dropdown) > Panel Preferences > Items > Add Item > Generic Monitor

In generic monitor give the exact location of the script like I have done here (also copy other details too)

Now save

Here's what is in the trial file

#!/bin/bash
eleven=$(vnstat --json | jq --arg day "$(date +'%d')" --arg month "$(date +'%m')" '.interfaces[0].traffic.day[] | select(.date.day == ($day | tonumber) and .date.month == ($month | tonumber)) | (.rx + .tx) / (1024*1024*1024)')
rounded_eleven=$(printf "%.2f" "$eleven")

echo " $rounded_eleven GB"

And that' about it, for Network Usage Gouger you need Network Monitor Package xfce4-netload-plugin You can see more into here

Adios!


[ORIGINAL POST]

edit: I am open to installing other packages, I ain't married to any of these packages.

I have installed vnstat package and it's quite handy. I have a few questions about it though.

  1. What is rx & tx mean in this package? rx stands for received tx stands for transmission

Is there a command to check data usage on my system using this? I mean, I want to create a Add an item to my panel which will show me my daily data usage updating it every minute. Basically, I want to to see what the arrow points to on the panel next to my date and I want it to update it every minute. I have 1.5GBs of data a day and I usually am not able to use it efficiently or I use too early and spent hours without data. So, I want to try and handle this problem by monitoring my data.


Note: I want to measure gauge data speed here, not do a speed test on how fast my internet is.

Also, I want to monitor the instantaneous rate of data usage and for that package bwm-ng does a great job, but I want to see in the panel and I want it to update every 0.5 s how can I achieve this?

I would like for a command to either view red arrow or the black arrow with the right mark depending upon which of them is instantaneous data speed


Note to Future self: rx : received tx : transmission lo : local loopback wlan0 : ethernet

top 4 comments
sorted by: hot top controversial new old
[-] [email protected] 3 points 9 months ago

I want to create a Add an item to my panel

On which environment? I'm pretty sure there's option on most of the window managers to display output of an command on a panel and (while it might need some scripting) it should be easy(ish, YMMV) to implement that.

[-] [email protected] 2 points 9 months ago

MX Linux xfce

I know it can be done because I have done it for something else. I don't know the commands to view those particular columns in the command tho.

[-] [email protected] 2 points 9 months ago

I'm not familiar with vnstat, but man page mentions --oneline -parameter, so something like vnstat --oneline|cut -d';' -f6 might be pretty close and you could format that as you wish with sed or awk, shell script or even python if you like.

[-] [email protected] 1 points 9 months ago

thank you very much! it works!

this post was submitted on 17 Sep 2023
27 points (100.0% liked)

Linux

45443 readers
967 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS