Coder Social home page Coder Social logo

thomasedoff / genmon-barchart.sh Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 125 KB

An XFCE GenMon script that displays customizable system information in a compact bar chart

Shell 100.00%
xfce xfce4-panel xfce4-genmon-plugin xfce4 system-monitoring

genmon-barchart.sh's Introduction

genmon-barchart.sh

An XFCE GenMon script that displays customizable system information in a compact bar chart.

genmon-barchart

Description

genmon-barchart.sh is a script that gathers system information and creates an SVG bar chart to be be displayed on an XFCE panel by xfce4-genmon-plugin (GenMon).

The script can be an alternative/addition to CPUGraph, Sensors, DiskPerf, etc. But the primary idea is to provide a compact overview of system activity.

To reduce overhead, the script retrieves data from procfs, sysfs, etc whenever favorable.

Bars

Bar Description
num_warn1 Log entries with importance warn or higher
num_users Users logged on
num_procs Running processes
cpu_freq Average CPU frequency
cpu_load Average CPU load
mem_usage Memory usage
disk_usage Disk usage
net_rxtx Network IO (receive/transmit)
net_skt Network sockets (TCP/UDP)
disk_rw Disk IO (read/write)
power1,2 Power consumption
temp2 Device temperature

1 Requires Superuser privileges
2 System-specific and likely to need tweaking

How to use

  1. Edit the General settings, Bars, Max values and SVG dimensions sections in the script.
  2. Add a General Monitor (xfce4-genmon-plugin) to a panel and set the script as the command.
  3. Configure the label and period to your liking.
  4. Optionally, pass an argument with the path to a file with settings to override the settings within the script.

Considerations

Most functions should be portable, but power and temp are system-specific. Please consider these functions examples rather than something that will work for you out of the box.

As noted, some functions require Superuser privileges. One way to to achieve this is to configure /etc/sudoers as such:

NAME_OF_USER ALL=NOPASSWD: /usr/local/bin/genmon-barchart.sh

Customization

  • Depending on how many bars you include in the chart, you may have to adjust svg_width to fit all bars without unnecessary margins.
  • If you are unsure of what maximum values to set, set them to auto and stress your system in order to record some approximate values.
  • Colors can be edited in the CSS <style>-tag within the script.
  • Hint: By inserting hard-coded 0's into the values_pcent indexed array, it is possible to create gaps between groups of bars.

Ideas/todo

  • Read up on and potentially implement further use of Pango Text Attributes in the tooltip.
  • Make use of and allow easy customization of GenMons <click> feature.
  • To not waste use of the pretty rainbow colors, perhaps do not increment colors when value is 0.
  • Bars are great! Need more bars! (Battery, fan speed, ...)

genmon-barchart.sh's People

Contributors

thomasedoff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

genmon-barchart.sh's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.