Index: uspace/app/launcher/launcher.c
===================================================================
--- uspace/app/launcher/launcher.c	(revision d8ddf7a17eaf0cf4fee87a5efb1faca4bb6562b2)
+++ uspace/app/launcher/launcher.c	(revision 552b69f240ec8edc47b2b988d0b23e54621bbde0)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2020 Jiri Svoboda
+ * Copyright (c) 2021 Jiri Svoboda
  * Copyright (c) 2012 Petr Koupy
  * All rights reserved.
@@ -56,5 +56,5 @@
 #define NAME  "launcher"
 
-static char *display_spec = UI_DISPLAY_DEFAULT;
+static const char *display_spec = UI_DISPLAY_DEFAULT;
 
 static void wnd_close(ui_window_t *, void *);
@@ -70,5 +70,5 @@
 };
 
-static int app_launch(const char *, const char *);
+static int app_launchl(const char *, ...);
 
 /** Window close button was clicked.
@@ -94,38 +94,73 @@
 
 	if (pbutton == launcher->pb1) {
-		app_launch("/app/terminal", NULL);
+		app_launchl("/app/terminal", "-c", "/app/nav", NULL);
 	} else if (pbutton == launcher->pb2) {
-		app_launch("/app/calculator", NULL);
+		app_launchl("/app/terminal", "-c", "/app/edit", NULL);
 	} else if (pbutton == launcher->pb3) {
-		app_launch("/app/uidemo", NULL);
+		app_launchl("/app/terminal", NULL);
 	} else if (pbutton == launcher->pb4) {
-		app_launch("/app/gfxdemo", "ui");
+		app_launchl("/app/calculator", NULL);
+	} else if (pbutton == launcher->pb5) {
+		app_launchl("/app/uidemo", NULL);
+	} else if (pbutton == launcher->pb6) {
+		app_launchl("/app/gfxdemo", "ui", NULL);
 	}
 }
 
-static int app_launch(const char *app, const char *arg)
+static int app_launchl(const char *app, ...)
 {
 	errno_t rc;
 	task_id_t id;
 	task_wait_t wait;
-
-	if (display_spec != UI_DISPLAY_DEFAULT) {
-		printf("%s: Spawning %s -d %s\n", NAME, app, display_spec);
-		rc = task_spawnl(&id, &wait, app, app, "-d", display_spec,
-		    arg, NULL);
-	} else {
-		printf("%s: Spawning %s\n", NAME, app);
-		rc = task_spawnl(&id, &wait, app, app, arg, NULL);
-	}
-
-	if (rc != EOK) {
-		printf("%s: Error spawning %s %s (%s)\n", NAME, app,
-		    display_spec != DISPLAY_DEFAULT ? display_spec :
-		    "<default>", str_error(rc));
+	va_list ap;
+	const char *arg;
+	const char **argv;
+	const char **argp;
+	int cnt = 0;
+	int i;
+
+	va_start(ap, app);
+	do {
+		arg = va_arg(ap, const char *);
+		cnt++;
+	} while (arg != NULL);
+	va_end(ap);
+
+	argv = calloc(cnt + 4, sizeof(const char *));
+	if (argv == NULL)
 		return -1;
-	}
 
 	task_exit_t texit;
 	int retval;
+
+	argp = argv;
+	*argp++ = app;
+
+	if (str_cmp(display_spec, UI_DISPLAY_DEFAULT) != 0) {
+		*argp++ = "-d";
+		*argp++ = display_spec;
+	}
+
+	va_start(ap, app);
+	do {
+		arg = va_arg(ap, const char *);
+		*argp++ = arg;
+	} while (arg != NULL);
+	va_end(ap);
+
+	*argp++ = NULL;
+
+	printf("%s: Spawning %s", NAME, app);
+	for (i = 0; argv[i] != NULL; i++) {
+		printf(" %s", argv[i]);
+	}
+	printf("\n");
+
+	rc = task_spawnv(&id, &wait, app, argv);
+	if (rc != EOK) {
+		printf("%s: Error spawning %s (%s)\n", NAME, app, str_error(rc));
+		return -1;
+	}
+
 	rc = task_wait(&wait, &texit, &retval);
 	if ((rc != EOK) || (texit != TASK_EXIT_NORMAL)) {
@@ -189,5 +224,5 @@
 	params.rect.p0.y = 0;
 	params.rect.p1.x = 210;
-	params.rect.p1.y = 300;
+	params.rect.p1.y = 345;
 
 	memset((void *) &launcher, 0, sizeof(launcher));
@@ -263,5 +298,7 @@
 	}
 
-	rc = ui_pbutton_create(ui_res, "Terminal", &launcher.pb1);
+	/* Navigator */
+
+	rc = ui_pbutton_create(ui_res, "Navigator", &launcher.pb1);
 	if (rc != EOK) {
 		printf("Error creating button.\n");
@@ -274,5 +311,5 @@
 	rect.p0.y = 130;
 	rect.p1.x = 190;
-	rect.p1.y = 158;
+	rect.p1.y = rect.p0.y + 28;
 	ui_pbutton_set_rect(launcher.pb1, &rect);
 
@@ -283,5 +320,7 @@
 	}
 
-	rc = ui_pbutton_create(ui_res, "Calculator", &launcher.pb2);
+	/* Text Editor */
+
+	rc = ui_pbutton_create(ui_res, "Text Editor", &launcher.pb2);
 	if (rc != EOK) {
 		printf("Error creating button.\n");
@@ -292,7 +331,7 @@
 
 	rect.p0.x = 15;
-	rect.p0.y = 170;
-	rect.p1.x = 190;
-	rect.p1.y = 198;
+	rect.p0.y = 130 + 35;
+	rect.p1.x = 190;
+	rect.p1.y = rect.p0.y + 28;
 	ui_pbutton_set_rect(launcher.pb2, &rect);
 
@@ -303,5 +342,7 @@
 	}
 
-	rc = ui_pbutton_create(ui_res, "UI Demo", &launcher.pb3);
+	/* Terminal */
+
+	rc = ui_pbutton_create(ui_res, "Terminal", &launcher.pb3);
 	if (rc != EOK) {
 		printf("Error creating button.\n");
@@ -312,7 +353,7 @@
 
 	rect.p0.x = 15;
-	rect.p0.y = 210;
-	rect.p1.x = 190;
-	rect.p1.y = 238;
+	rect.p0.y = 130 + 2 * 35;
+	rect.p1.x = 190;
+	rect.p1.y = rect.p0.y + 28;
 	ui_pbutton_set_rect(launcher.pb3, &rect);
 
@@ -323,5 +364,7 @@
 	}
 
-	rc = ui_pbutton_create(ui_res, "GFX Demo", &launcher.pb4);
+	/* Calculator */
+
+	rc = ui_pbutton_create(ui_res, "Calculator", &launcher.pb4);
 	if (rc != EOK) {
 		printf("Error creating button.\n");
@@ -332,7 +375,7 @@
 
 	rect.p0.x = 15;
-	rect.p0.y = 250;
-	rect.p1.x = 190;
-	rect.p1.y = 278;
+	rect.p0.y = 130 + 3 * 35;
+	rect.p1.x = 190;
+	rect.p1.y = rect.p0.y + 28;
 	ui_pbutton_set_rect(launcher.pb4, &rect);
 
@@ -343,8 +386,49 @@
 	}
 
+	/* UI Demo */
+
+	rc = ui_pbutton_create(ui_res, "UI Demo", &launcher.pb5);
+	if (rc != EOK) {
+		printf("Error creating button.\n");
+		return rc;
+	}
+
+	ui_pbutton_set_cb(launcher.pb5, &pbutton_cb, (void *) &launcher);
+
+	rect.p0.x = 15;
+	rect.p0.y = 130 + 4 * 35;
+	rect.p1.x = 190;
+	rect.p1.y = rect.p0.y + 28;
+	ui_pbutton_set_rect(launcher.pb5, &rect);
+
+	rc = ui_fixed_add(launcher.fixed, ui_pbutton_ctl(launcher.pb5));
+	if (rc != EOK) {
+		printf("Error adding control to layout.\n");
+		return rc;
+	}
+
+	/* GFX Demo */
+
+	rc = ui_pbutton_create(ui_res, "GFX Demo", &launcher.pb6);
+	if (rc != EOK) {
+		printf("Error creating button.\n");
+		return rc;
+	}
+
+	ui_pbutton_set_cb(launcher.pb6, &pbutton_cb, (void *) &launcher);
+
+	rect.p0.x = 15;
+	rect.p0.y = 130 + 5 * 35;
+	rect.p1.x = 190;
+	rect.p1.y = rect.p0.y + 28;
+	ui_pbutton_set_rect(launcher.pb6, &rect);
+
+	rc = ui_fixed_add(launcher.fixed, ui_pbutton_ctl(launcher.pb6));
+	if (rc != EOK) {
+		printf("Error adding control to layout.\n");
+		return rc;
+	}
+
 	ui_window_add(window, ui_fixed_ctl(launcher.fixed));
-
-	(void) ui_res;
-	(void) app_launch;
 
 	rc = ui_window_paint(window);
