diff --git a/README b/README index 50b3804..e87d8e3 100644 --- a/README +++ b/README @@ -53,6 +53,7 @@ OPTIONS --monitor - define the mointor on which you like trayer to appear, number of zero to number of monitors minus one, or the string "primary". + --iconspacing - Space between tray icons in pixels. TRAYER IN DISTROS diff --git a/main.c b/main.c index be4541b..bdf5bdc 100644 --- a/main.c +++ b/main.c @@ -87,6 +87,7 @@ tray_constructor(panel *p) tr->panel = p; tr->mainw = gtk_alignment_new (0.5, 0.5, 1.0, 1.0); tr->box = p->my_box_new(FALSE, 1); + gtk_box_set_spacing(GTK_BOX(tr->box), p->icon_spacing); gtk_container_add (GTK_CONTAINER (tr->mainw), tr->box); gtk_container_add(GTK_CONTAINER(p->box), tr->mainw); diff --git a/panel.c b/panel.c index e9bf8c4..a97ec4c 100644 --- a/panel.c +++ b/panel.c @@ -424,6 +424,7 @@ usage() printf(" --expand (default:true)\n"); printf(" --padding (default:0)\n"); printf(" --monitor (default:0)\n"); + printf(" --iconspacing (default:0)\n"); } void @@ -461,6 +462,7 @@ main(int argc, char *argv[], char *env[]) p->setdocktype = 1; p->setstrut = 0; p->transparent = 0; + p->icon_spacing = 0; p->alpha = 127; p->tintcolor = 0xFFFFFFFF; p->xtopbg = None; @@ -634,6 +636,15 @@ main(int argc, char *argv[], char *env[]) p->on_primary = 1; } } + } else if (!strcmp(argv[i], "--iconspacing")) { + i++; + if (i == argc) { + ERR( "trayer: missing icon padding parameter value\n"); + usage(); + exit(1); + } else { + p->icon_spacing = atoi(argv[i]); + } } else { printf("trayer: unknown option - %s\n", argv[i]); usage(); diff --git a/panel.h b/panel.h index 4dee5c2..7b284ff 100644 --- a/panel.h +++ b/panel.h @@ -47,6 +47,7 @@ typedef struct { int transparent : 1; int on_primary : 1; int monitor; + int icon_spacing; // Import from plugin structure gpointer priv;