Ubuntu / Linux news and application reviews.

Sysmonitor Indicator is an Ubuntu AppIndicator that can display the CPU, memory, swap, filesystem and network usage as values on the panel. 

Furthermore, the AppIndicator comes with a very interesting feature: it can display the output of your own custom commands / bash scripts on the panel.

The AppIndicator wasn't updated in a long time and it was buggy, at least in Ubuntu 14.04, so fossfreedom forked it, fixed the bugs and uploaded Sysmonitor Indicator to a PPA. Update: the indicator also works in Ubuntu 16.04 and 16.10.

Install Sysmonitor Indicator in Ubuntu

To add the new Sysmonitor Indicator PPA created by fossfreedom and install the indicator in Ubuntu 16.10, 16.04 or 14.04, use the following commands:
sudo add-apt-repository ppa:fossfreedom/indicator-sysmonitor
sudo apt-get update
sudo apt-get install indicator-sysmonitor
If you're using an older Ubuntu version or you don't want to add the PPA, grab the Sysmonitor Indicator deb file from HERE.

Once installed, launch "System monitor indicator" from the menu / Dash. The indicator doesn't start automatically when you login - to enable this, from its preferences, on the General tab, enable "Run on startup".

How to get Sysmonitor Indicator to display bash scripts output on the panel

1. To get a bash script output to be displayed on the panel with Sysmonitor Indicator, open the indicator preferences and on the Advanced tab, click "New":

2. Here, enter a name and description for your script and under "Command", enter the path to your script - for instance, if you create a script called "test" in the "scripts" folder in your home directory, you'll have to use this in the "Command" field: "$HOME/scripts/test" (without the quotes).

3. Clear the "Customize output" field, then select your newly added script from the "Sensors" list and click "Add":

You can add as many scripts to the output as you want (so you can add your own custom script output next to the CPU usage for instance, etc.). Click "Save" when you're done.

By default, Sysmonitor Indicator runs the scripts at a 2 second interval but, depending on your script, you may want to change that (for instance, most commands/scripts in the examples below would work properly even with an update interval of a few hours or even one day - 86400 seconds). To change the update interval, in the Sysmonitor Indicator preferences, on the Advanced tab, change the "Update interval" value to whatever you want.


Here are a few examples of commands/scripts that can be used with Sysmonitor Indicator (to use the examples below, copy/paste the command in a file, make it executable and point Sysmonitor Indicator to it as explained above):

- display the current CPU frequency for the first core:

echo $(grep "cpu MHz" /proc/cpuinfo | head -1 | cut -d ' ' -f3 | cut -d '.' -f1) MHz

- display the current average (all cores) CPU frequency (no screenshot since well, it looks the same as above):
sum=$(for line in `grep "cpu MHz" /proc/cpuinfo`; do echo "$line" | sed -e '/cpu/d' -e '/MHz/d' -e '/:/d' | cut -d '.' -f1;  done | paste -sd+ - | bc)
cores=$(grep "cpu MHz" /proc/cpuinfo | wc -l)
echo $(($sum/$cores)) MHz

- display your public IP address on the panel (make sure "curl" is installed):

curl ipv4.icanhazip.com
Other websites you can use to get your current public IP address as plain text (useful to get the IP via "curl", like in the command above): ifconfig.me and ipecho.net/plain .

- check if a website is up or down: display "☺" on the panel if it's up and "☹" if it's down (make sure "wget" is installed):

if wget -O /dev/null webupd8.org > /dev/null; then echo "☺"; else echo "☹"; fi

- display a countdown to the Ubuntu 14.10 release:

echo $(( ($(date --date="141016" +%s) - $(date +%s) )/(60*60*24) )) days

These are just a few simple examples, you can do many other things with this. For instance, a while back I wrote a script to display the network speed on the panel (back then Sysmonitor Indicator didn't have a built-in option for this).

It's important to note that you can't display icons or change the font text color for the script output using this indicator.

The script output displayed on the panel by Sysmonitor Indicator can change its length every time the indicator runs the script and that can be annoying because it moves the other indicators but there's a work-around for this: you can set Sysmonitor Indicator to be displayed as the first indicator on the left, like in my screenshots above - see how to change Ubuntu AppIndicators order.

To report bugs, help improve Sysmonitor Indicator and so on, see its GitHub page (fork by fossfreedom).

Also see: Zenity For Appindicators: Ubuntu Indicator For Commands Or Bash Scripts