Unity's panel indicators have their own advantages. For example, the functionality they offer is easily accessible irrespective of what you are doing on the system. This may be one of the reasons why users would sometimes want to create an indicator capable of doing custom tasks that are nothing but pre-defined commands.
In this tutorial, we will discuss how you can do this. But before that, it's worth knowing that all commands and instructions mentioned here have been tested on Ubuntu 16.04 LTS.
How to create custom Unity panel indicator
The following steps will let you do this:
Firstly, create a file named run_commands.py, and copy the following contents to it:
Next, choose an icon (preferably 100x100 in size), name it icon.png, and save it in the same directory as the aforementioned script. Now, create another file named commands in the same directory, and populate it will stuff like:
Here, the first entry is the name of the item in the indicator menu. The double-pipe symbol is a separator, while the last entry is the corresponding command that will be executed when the entry gets clicked.
After all the above mentioned steps are done, execute the following command:
In our case, the above command created the following indicator.