1

I'm trying my hand at writing simple desktop utility apps in PHP and wxWidgets using wxPHP. After some substantial effort (and 20+ minutes of compilation time) to generate the PHP wxwidgets.so module, I thought I'd start with a simple status indicator. I am running PHP 5.5.9 on Ubuntu 14.04 LTS.

I asked a question on Stack Overflow, and have been appending additional research as I await answers. It turns out that it isn't straightforward in recent versions of Ubuntu, since (a) versions after 11.x operated a whitelist to permit ordinary wxTaskBarIcon icons to appear, and (b) since 13.10 wxTaskBarIcon icons do not appear at all, and Ubuntu requires special treatment.

I find that there is a hack to bring the whitelist back to 14.x but it requires tinkering with the trusted repos, and in any case I'd rather just do it properly.

I see from Ask Ubuntu that there are questions on how to find the PID of the live status icons, and how to add menu items to the session ("cog") applet. These both make use of DBus calls from the command line. Tantalisingly there is a question on exactly what I want to achieve but the answers rely on libappindicator, for which PHP does not have bindings available.

I therefore think there must be DBus calls I can make from the console (and ergo from a PHP application also) but the documentation for this sits somewhere between thin and non-existent. I've tried browsing various items of source code on GitHub, but short of searching for a few freedesktop.org command strings, I don't really know what I am looking for. I also draw a blank with the official documentation, unless I am missing something really obvious.

My questions therefore are: can an Application Indicator be created using DBus calls on the command line, and if so, how? I want to play with icons, text, menus and anything the system indicators can do. Or, if DBus is not the way to go about things, how can I do what libappindicator does, given that I don't have bindings for that library for my preferred language?


Edit: I've added a self-answer to my question on Stack Overflow, indicating that the best available solution at present is to build a separate indicator app in Python and open up a communication channel between that and the wxPHP app.

However, I will keep this question open, since it is slightly different - how to achieve the same ends, from PHP, using DBus. (I expect I can work out how to send DBus messages in PHP, but the format is what I would need).

0

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.