The Cookie Machine - Click here to drag window

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

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

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: November 24, 2022    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 ( - 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 > /dev/null; then echo "☺"; else echo "☹"; fi`
⇧ Can BASH display in systray as application indicator? Turning off text highlighting  â‡©