Hi Arjan,

thank you for the answer. I cannot use xorg-server at the moment, because it has issues with my system. i have created an (quick and dirty) patch to specify an xorg configfile to uxlanch. eventually you can include things like this.

stephan



Am 22.03.2010 01:47, schrieb Arjan van de Ven:
On 3/21/2010 5:30, Stephan Raue wrote:
Hi,

i use uxlaunch for an embedded project. it works great, but i want setup
some options to xorg:

for example my system detects the graphic card. if an nvidia graphic
card is used i want start xorg with "-config /etc/xorg/xorg-nvidia.conf"
if i have another card installed i dont want setup this option. i can do
this without uxlaunch, but is it possible to do this with uxlaunch (set
shell variables or options to uxlaunch - not in uxlaunch configfile)?


A better solution for your situation is to use X 1.8; it has a much improved configuration file system that can handle cases like this (and others you mention) internally to X.



--
              ### OpenELEC.tv ###
The free and open Mediacenter Distribution 4 you
             http://www.openelec.tv

diff -Naur uxlaunch-0.46/options.c uxlaunch-0.46.patch/options.c
--- uxlaunch-0.46/options.c	2010-03-04 19:51:44.000000000 +0100
+++ uxlaunch-0.46.patch/options.c	2010-03-21 14:07:15.273504664 +0100
@@ -27,6 +27,7 @@
 int tty = 2;
 char session[256] = "/usr/bin/mutter --sm-disable";
 char username[256] = "moblin";
+char xconfig[256] = "/etc/X11/xorg.conf";
 
 int verbose = 0;
 
@@ -34,6 +35,7 @@
 	{ "user",    1, NULL, 'u' },
 	{ "tty",     1, NULL, 't' },
 	{ "session", 1, NULL, 's' },
+	{ "xconfig", 1, NULL, 'c' },
 	{ "help",    0, NULL, 'h' },
 	{ "verbose", 0, NULL, 'v' },
 	{ 0, 0, NULL, 0}
@@ -46,6 +48,7 @@
 	printf("  -u, --user      Start session as specific username\n");
 	printf("  -t, --tty       Start session on alternative tty number\n");
 	printf("  -s, --session   Start a non-default session\n");
+	printf("  -c, --xconfig   Xorg config file\n");
 	printf("  -v, --verbose   Display lots of output to the console\n");
 	printf("  -h, --help      Display this help message\n");
 }
@@ -126,13 +129,15 @@
 				tty = atoi(val);
 			if (!strcmp(key, "session"))
 				strncpy(session, val, 256);
+			if (!strcmp(key, "xconfig"))
+				strncpy(xconfig, val, 256);
 		}
 		fclose(f);
 	}
 
 	/* parse cmdline - overrides */
 	while (1) {
-		c = getopt_long(argc, argv, "u:t:s:hv", opts, &i);
+		c = getopt_long(argc, argv, "u:t:s:c:hv", opts, &i);
 		if (c == -1)
 			break;
 
@@ -146,6 +151,9 @@
 		case 's':
 			strncpy(session, optarg, 256);
 			break;
+		case 'c':
+			strncpy(xconfig, optarg, 256);
+			break;
 		case 'h':
 			usage(argv[0]);
 			exit (EXIT_SUCCESS);
@@ -171,7 +179,7 @@
 	}
 
 	lprintf("uxlaunch v%s started.", VERSION);
-	lprintf("user \"%s\", tty #%d, session \"%s\"", username, tty, session);
+	lprintf("user \"%s\", tty #%d, session \"%s\", xconfig \"%s\"", username, tty, session, xconfig);
 
 	pass = getpwnam(username);
 	if (!pass)
diff -Naur uxlaunch-0.46/uxlaunch.h uxlaunch-0.46.patch/uxlaunch.h
--- uxlaunch-0.46/uxlaunch.h	2010-03-04 19:51:44.000000000 +0100
+++ uxlaunch-0.46.patch/uxlaunch.h	2010-03-21 14:09:01.116504932 +0100
@@ -19,6 +19,7 @@
 extern int tty;
 extern char session[];
 extern char username[];
+extern char xconfig[];
 
 extern int session_pid;
 extern int xpid;
diff -Naur uxlaunch-0.46/xserver.c uxlaunch-0.46.patch/xserver.c
--- uxlaunch-0.46/xserver.c	2010-03-04 19:51:44.000000000 +0100
+++ uxlaunch-0.46.patch/xserver.c	2010-03-21 14:07:43.871631141 +0100
@@ -231,13 +231,13 @@
 		execl(xserver, xserver,  displayname,
 		      "-nolisten", "tcp", "-dpi", "120", "-noreset",
 		      "-auth", xauth_cookie_file,
-		      vt, NULL);
+		      vt, "-config", xconfig, NULL);
 	} else {
 		execl(xserver, xserver,  displayname,
 		      "-nolisten", "tcp", "-dpi", "120", "-noreset",
 		      "-auth", user_xauth_path,
 		      "-logfile", xorg_log,
-		      vt, NULL);
+		      vt, "-config", xconfig, NULL);
 	}
 	exit(0);
 }
_______________________________________________
Moblin dev Mailing List
dev@moblin.org

To manage or unsubscribe from this mailing list visit:
http://lists.moblin.org/listinfo/dev or your user account on http://moblin.org 
once logged in.

For more information on the Moblin Developer Mailing lists visit:
http://moblin.org/community/mailing-lists

Reply via email to