The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

If you can read me, I'm broken!

Views: 2,949     Votes:  3 
Tags: unity   bash   system-tray  
Link: 🔍 See Original Answer on Ask Ubuntu ⧉ 🔗

URL: https://askubuntu.com/q/881548
Title: How to display something in unity systray from a bash script
ID: /2017/02/09/How-to-display-something-in-unity-systray-from-a-bash-script
Created: February 9, 2017    Edited:  June 12, 2020
Upload: September 15, 2024    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false


Indicator System Monitor

indicator system monitor

The closest method I’ve found to satisfy your requirements is (webupd8.org - Ubuntu appindicator that displays bash) that displays text on the Unity system tray / application indicator bar. The sample above comes from two bash scripts: multi-timer and display-auto-brightness.

Install and Configure Sysmonitor Indicator

You need to install indicator-sysmonitor from ppa:

sudo add-apt-repository ppa:fossfreedom/indicator-sysmonitor
sudo apt-get update
sudo apt-get install indicator-sysmonitor

Then run the gui and configure it with the script name that updates the system tray.

Sample scripts to output to system tray

Here are a few examples from the WebUpd8 link above:

`echo $(grep "cpu MHz" /proc/cpuinfo | head -1 | cut -d ' ' -f3 | cut -d '.' -f1) MHz`
`if wget -O /dev/null webupd8.org > /dev/null; then echo "☺"; else echo "☹"; fi`
⇧ In Ubuntu Unity, can I display the output of a bash script in the systray area? Turning off text highlighting  ⇩