Skip to content

Instantly share code, notes, and snippets.

@mpereira
Created July 1, 2012 00:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpereira/3026227 to your computer and use it in GitHub Desktop.
Save mpereira/3026227 to your computer and use it in GitHub Desktop.
#include <gtk/gtk.h>
#include <libappindicator/app-indicator.h>
int main(int argc, char **argv) {
gtk_init(&argc, &argv);
AppIndicator *app_indicator;
app_indicator = app_indicator_new("foo",
"",
APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
app_indicator_set_status(app_indicator, APP_INDICATOR_STATUS_ACTIVE);
app_indicator_set_label(app_indicator, "foo", "foo");
gtk_main();
return(0);
}
@mpereira
Copy link
Author

mpereira commented Jul 1, 2012

I'm compiling it with:

gcc indicator-foo.c -Wall -pthread -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/libdbusmenu-glib-0.4 -I/usr/include/libappindicator3-0.1  -lappindicator3 -ldbusmenu-glib -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0 -o indicator-foo

The compilation succeeds without warnings and the program is also run without warnings if run by the super user. If not, it yields the following output:

** (indicator-netspeed:13390): WARNING **: Could not connect: Connection refused
(indicator-netspeed:13390): libappindicator-WARNING **: Unable to get the session bus: Could not connect: Connection refused

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment