- d->type = TIMED_MENU_STAT;
- d->timer = timer_start(6000000, &timed_menu_timeout_handler, m);
- d->command = "/home/woodblock/timed_menu_stat";
+ if (data->parent)
+ menu_add_entry(data->parent, menu_entry_new_submenu(
+ (label != NULL ? label : ""),
+ m));
+
+ if (!parse_attr_string("command", data->node, &d->command)) {
+ d->command = g_strdup("");
+ }
+
+ if (parse_attr_string("timeout", data->node, &timeout)) {
+ char *endptr;
+ gdouble timeout_val = g_strtod(timeout, &endptr);
+ g_free(timeout);
+ d->timer = timer_start(timeout_val * 1000000,
+ &timed_menu_timeout_handler, m);
+ } else
+ d->timer = timer_start(600 * 1000000, &timed_menu_timeout_handler, m);
+
+ d->type = TIMED_MENU_PIPE;