An XFCE GenMon script that displays customizable system information in a compact bar chart.
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.
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
- Edit the
General settings
,Bars
,Max values
andSVG dimensions
sections in the script. - Add a General Monitor (xfce4-genmon-plugin) to a panel and set the script as the command.
- Configure the label and period to your liking.
- Optionally, pass an argument with the path to a file with settings to override the settings within the script.
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
- 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.
- 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, ...)