This is not a duplicate of How to create Unity indicators?. I'm looking for system indicator not application indicator.
Backgound:
From these two questions:
- How do I add or manipulate Application/System Indicators in the login screen?
- How to make indicator-sysmonitor as a default indicator on the login screen
I learned that there are two types of indicators:
- System: sound, keyboard, application,... (try:
ps ax | grep indicator
) - Application: nm-applet, sysmonitor,... and almost all which are listed in What Application Indicators are available?
All application indicators are handled/showed by indicator-application (a system one). System indicators are showed directly by Unity panel.
Both questions are about adding/removing indicators from login & lock screen. The first was a straight forward setup (when dealing with system indicators). The second was a tough setup (when dealing with app indicators), which needs modifying the source of panel service (unity package) for lock screen and the source of unity-greeter for login screen.
As the case of sysmonitor
, to me that was workaround. The best solution is to implement a system indicator instead of an application one.
Topic:
Is there a unified API for system indicators (Preferably: Python then C/C++)? Please, reference to the official documentations.
Most system indicators are written using Vala programming language. Could any one write small demo for a system indicator using Python or C?
Update:
I found few links that may give a push:
In Application Indicators project page, They listed links to AppIndicator-0.3 API (C & Python) used for application indicators.
They listed also Indicate-0.7 API (C & Python). What is this?Well, it is a DBus messaging channel between Desktop Applications.On other hand, in System Indicators project page, they mentioned:
System Indicator APIs
Messaging Menu using libindicate.- Sound Menu using libunity.
Date/Time Indicator using Evolution-Data-Server
They seem listing Data API not Indicator Development API like for Evolution-Data-Server. But not sure about
libindicate &libunity. Did any one work with these two libraries?Try
apt-cache rdepends libunity9 libindicator7 libindicator3-7
to see which indicator is relaying these libraries.
Update2: This to keep interested users updated.
From what I have collected till now, here is the order of possible solutions:
libindicator3-7
(high, Many indicators depend on it)I found some test examples in the source, some dummy indicators that I have tried, could be installed in
/usr/lib/indicators3/7/
, they are shared lib.so
. I could get them displayed in Login & Regular Session but Not in Lock Screen.However there are some test indicator services, which seems like Unity system ones. I haven't tried them yet.
libindicator7
From same source as libindicator3-7, from rdepends:
mate-indicator-applet lxpanel-indicator-applet-plugin
It seems to be used to make container for indicators in panels.
libunity9
(low)No research yet
System Indicator Service
Well, it is really simpler then I expected. There is no specific API for it. Because it is just a GSimpleActionGroup & with corresponding GMenu's exported through DBus then Unity is told about their presence using declaration file with same name put in
/usr/share/unity/indicators/
. No need for any other library.Here a very small C language example:
Get a copy of
tests/indicator-test-service.c
fromlibindicator
sourceindicator-test-service.c no changes
com.canonical.indicator.test modified to add lock & greeter mode
com.canonical.indicator.test.service remove
.in
postfix from filename and change the executable pathCompile it
Manual Installation
Configuration for Greeter, override the default indicators list
90_unity-greeter.gschema.override
Install
Test
Notes
DBus service is troublesome, if you want user to be able to close application anytime. It is better to use autostart instead, like default indicators do.
I have uploaded ready files here:
https://github.com/sneetsher/mysystemindicator_minimum
and a modified copy here:
https://github.com/sneetsher/mysystemindicator
Where I have tried different menu for different mode. It could be installed and tested quickly.
This seems too simple and can be easily ported to any other language that have support for GIO Gnome lib (including DBus). As I'm looking for python, I may add it later.
References:
System Indicator Plugin
This is not full standalone indicator as the one above, it is just a share lib plugin, similar to
libappmenu.so
&libprintersmenu.so
(application menu & printer indicator). It could be shown only in regular user session & greeter (Not on lock screen).I couldn't make it work in my current machine, but I did before. Here the steps, may be I'm missing something.
Using same source above of
libindicator
test/libdummy-indicator-*.c
are examples (simple & visible the ones show up on the panel)Compile
Install
Configure to show in greeter screen
90_unity-greeter.gschema.override use same name without
lib
prefix and.so
extension.Install
NOTE: Please check the bottom of this post for the final say on this answer.
I don't know if I am really of any assistance, but I hope that this idea may be useful.
From what I have searched, the difference in System and Application Indicators is distinct. With this in mind, I now introduce a questionable concept:
The idea came to me while looking at the following posts:
https://askubuntu.com/a/234204/408654
https://askubuntu.com/a/42213/408654
The Unity API appears to be primarily built for use with Application Indicators, but both System and Application Indicators may use similar programming (C lang). However, you mentioned earlier that these two types of Indicators are handled by two different systems. As such, I then proceeded to read one of your sources:
How do I add or manipulate Application/System Indicators in the login screen?
The primary answer involved overriding an already-existing user to gain the access they required. It also provided a solution for adding and removing all existing Indicators. It's a unified management solution for Indicators. Would it be possible to override a default (pre-existing) user to run/introduce a System Indicator?
In response to this part of your query:
Unfortunately, though, there is no way to use Application Indicator APIs for System Indicators. As such, my solution is void :(