Applet for data usage (for metered connections)

Hello, I have been working on an applet that lives on the desktop, similar to ShowTime, that displays data usage (of the computer only!). This was a personal project but I wanted to see if anyone else would find it useful, so I uploaded it to github.

The applet uses vnstat, which will need to be setup and configured first before running! I may add a setup script in the applet itself if needed. It parses the usage of yesterday, today, the week, and the month’s data usage and displays it accordingly.
Everything from setting the color of the display’s text, and shadow colors, to picking different interfaces to monitor, as well as display options* are customizable in the Budgie Desktop Settings.
*The display settings are short, long, detailed, and minimal, it still needs work on the specific wording as I can’t even choose what to name a variable most days…

Note 1: Keep in mind it may have references to ShowTime Icon, if that’s a problem I can go through and remove any of that, like I said it was a personal project.
Note 2: The datacap is no longer hardcoded, updated setting ui to reflect changes.

*I used ShowTime as a base to get started, credit for most the code style, idea for my project to live on the desktop, and the settings UI all go to Budgie ShowTime Author Jacob Vlijm

Github link:

1 Like

Hi - nice to see a fellow developer! Congrats on your project.

Just a few random thoughts when I skimmed through the project - please dont take any of this as a criticism - just some personal feedback to you

  1. Please add a License file to the root of the project - I’m guessing GPL-3 since you mentioned showtime as its basis
  2. For each source file add a license header with the key authors of the source file
  3. For modules or substantial parts borrowed from another project you should keep the license header intact from that project - just append to the authors for you
  4. Nice to have for packagers - consider having a meson type installation i.e. meson.build.
  5. You probably should have some-sort of parsing routine in the plugin to take the relevant parts of vnstat --iflist and send it to vnstat --create followed by the systemctl enable stuff. That way the plugin is self contained without users needing to do a bunch of command line stuff. Without this it cannot be packaged since users will never see the project & readme
  6. Future thoughts? Have a warning threshold capability? WIth a warning threshold maybe change the colour on the text on the screen to a warning … and send a notification
  7. Future thoughts? Have a data limit capability? If the data limit is reached you might want to disconnect the network (nm-cli) so that there is no chance (for example if left on overnight) that the data limit is breached
  8. Future thoughts? Have an automatic data limit reset daily/weekly/monthly?
  9. Settings - maybe have “Show:” as a label then have yesterday/today on one line, week/month on the next line - just to combine things rather than elongate vertically - same comment for the colour
  10. Future thoughts? As a british person I hate seeing people spell ‘colour’ wrongly - any chance of some-sort of localisation capability?

#1 & 2. To be honest I’ve never really released any of my programs before, I’ve mainly just helped others out. When it comes to the licensing and all of that I am not really sure what I am doing. Any chance you can help me out and point me in the right direction?
#3. I’ll append the license and author back into most the source files tonight after work.
#4. I will also look into the meson.build, I had never never heard of it before.
#5. Yes I was planning on using a “setup button” which will pop open a window with the relevant information for ‘vnstat --ifconfig’ and use that in the creation of the DB along with enabling and disabling the service. I just wasn’t sure if that was allowed in an applet.
#6. Yes I plan to have warnings, along with notifications, but it was also a problem with the fact that vnstat also include local transfers, ie phone to computer will count the data usage if using wifi, and its only on a single computer. I am aware that vnstat can be used with OpenWrt which I may need to look into as an option for anyone who might want it.
#7. The above issue also goes with the data limit capability, turning wifi off and such. Possibly adding a daily as well as monthly limit may be useful even if there are other connections in the house.
#8. The way it’s setup vnstat will reset the daily once a day, weekly at the end of the week, and monthly whenever your billing cycle dates end, which you input into the .vnstatrc config, I believe that’s what you were meaning in #8.
#9. And as for #9 I will get on that after work, I was thinking 21 items going down seem a bit much…
#10. I will definitely look into localization, I prefer colour over color in the spellings, but as it was already in ShowTime’s source I just went with it, if you compare the ShowTime source and mine, they are pretty similar in the initialization because that was my starting point, I just organized and renamed things after I was finished.