Code: Select all
/* gcc `pkg-config gtk+-x11-2.0 --cflags` -Os -o sit sit.c -lgtk-x11-2.0 -s */
#include <gtk/gtk.h>
int main(int argc, char *argv[]){
GtkStatusIcon *widget; int i=1;
gtk_init (&argc, &argv);
while (i<argc) {
widget = gtk_status_icon_new_from_file(argv[i++]);
gtk_status_icon_set_tooltip(widget,argv[i++]);
gtk_status_icon_set_visible(widget,TRUE);}
gtk_main ();
return 0;}
This is not a full featured implementation by any means, only an easy way to show multiple status icons
I intentionally used deprecated widgets so as to be compatible with gtk+-2.10
(to use in gtk3 change gtk_status_icon_set_tooltip to gtk_status_icon_set_tooltip_text)
usage
sit /full/icon/path/icon.png "tooltip text" /path/to/another/icon.svg "another tooltip" ...
it draws extremely fast so it can be used in a shell daemon process thusly
Code: Select all
kill $SITPID
sit $ICON1 $TOOLTIP1 $ICON2 $TOOLTIP2 &
SITPID=$!