Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fwife.git;a=commitdiff;h=e1e1e2167be045fc25b82e5b705bc8b11e4c0259

commit e1e1e2167be045fc25b82e5b705bc8b11e4c0259
Author: Elentir <elen...@frugalware.org>
Date:   Mon Jul 12 13:40:13 2010 +0200

remove a part of xorg configuration not necessary any more

diff --git a/autoclean.sh b/autoclean.sh
index e549443..5f1585f 100755
--- a/autoclean.sh
+++ b/autoclean.sh
@@ -25,8 +25,8 @@ rm -rf mkinstalldirs
rm -rf config.rpath
rm -rf data/Makefile.in
rm -rf data/Makefile
-rm -rf data/{images,scripts,kmconf}/Makefile.in
-rm -rf data/{images,scripts,kmconf}/Makefile
+rm -rf data/{images,kmconf}/Makefile.in
+rm -rf data/{images,kmconf}/Makefile
rm -rf data/images/flags/Makefile.in
rm -rf data/images/flags/Makefile
rm -rf po/stamp-it
diff --git a/configure.ac b/configure.ac
index 49c17db..d04a4b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -94,7 +94,6 @@ AC_CHECK_LIB([fwmouseconfig], [fwmouse_writeconfig], 
[PLUGINS_LIBS="$PLUGINS_LIB
AC_CHECK_LIB([fwnetconfig], [fwnet_iflist], [PLUGINS_LIBS="$PLUGINS_LIBS 
-lfwnetconfig"])
AC_CHECK_LIB([fwtimeconfig], [fwtime_find], [PLUGINS_LIBS="$PLUGINS_LIBS 
-lfwtimeconfig"])
AC_CHECK_LIB([fwutil], [fwutil_init], [PLUGINS_LIBS="$PLUGINS_LIBS -lfwutil"])
-AC_CHECK_LIB([fwxconfig], [fwx_doconfig], [PLUGINS_LIBS="$PLUGINS_LIBS 
-lfwxconfig"])
AC_CHECK_LIB([pacman], [pacman_initialize], [PLUGINS_LIBS="$PLUGINS_LIBS 
-lpacman"])
AC_CHECK_LIB([parted], [ped_device_read], [PLUGINS_LIBS="$PLUGINS_LIBS 
-lparted"])

@@ -134,7 +133,6 @@ src/plugins/Makefile
data/Makefile
data/images/Makefile
data/images/flags/Makefile
-data/scripts/Makefile
data/kmconf/Makefile
po/Makefile.in
Makefile
diff --git a/data/Makefile.am b/data/Makefile.am
index 2ea9d98..0ae7fbe 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1 +1 @@
-SUBDIRS = images kmconf scripts
+SUBDIRS = images kmconf
diff --git a/data/scripts/Makefile.am b/data/scripts/Makefile.am
deleted file mode 100644
index 774c917..0000000
--- a/data/scripts/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-scriptsdir = $(pkgdatadir)/scripts/
-
-scripts_SCRIPTS = xkeybchange
diff --git a/data/scripts/xkeybchange b/data/scripts/xkeybchange
deleted file mode 100644
index a47dafb..0000000
--- a/data/scripts/xkeybchange
+++ /dev/null
@@ -1,35 +0,0 @@
-#! /bin/sh
-
-XConfig=$3/etc/X11/xorg.conf
-XTemp=$3/tmp/xorg.conf.new
-
-XkbModel="$(cat $XConfig | grep "Option \"XkbModel\"" | cut -f 4 -d "\"")"
-XkbLayout="$(cat $XConfig | grep "Option \"XkbLayout\"" | cut -f 4 -d "\"")"
-
-if [ "$XkbModel" = "" ]; then
-sed '10,$s/Keyboard0/Keyboard1/' $XConfig > $XTemp
-if [ "$2" != "default" ]; then
-cat <<EOF>> $XTemp
-Section "InputDevice"
-        Identifier  "Keyboard0"
-        Driver      "kbd"
-       Option "XkbModel"   "$2"
-       Option "XkbLayout"  "$1"
-EndSection
-EOF
-else
-cat <<EOF>> $XTemp
-Section "InputDevice"
-        Identifier  "Keyboard0"
-        Driver      "kbd"
-       Option "XkbLayout"  "$1"
-EndSection
-EOF
-fi
-cp $XTemp $XConfig
-
-else
-cp $XConfig $XTemp
-if [ "$1" != "" ]; then sed -r "s|$XkbLayout|$1|" $XConfig > $XTemp; cp $XTemp 
$XConfig; fi
-if [ "$2" != "default" ]; then sed -r "s|$XkbModel|$2|" $XConfig > $XTemp; cp 
$XTemp $XConfig; fi
-fi
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 1fa61b0..0592712 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -2,8 +2,7 @@ INCLUDES = @GTK_CFLAGS@
DEFS = @DEFS@ \
-DPLUGINDIR="\"$(pkglibdir)/plugins\"" \
-DIMAGEDIR="\"$(pkgdatadir)/images\"" \
-       -DKEYDIR="\"$(pkgdatadir)/kmconf\"" \
-       -DSCRIPTDIR="\"$(pkgdatadir)/scripts\""
+       -DKEYDIR="\"$(pkgdatadir)/kmconf\""

pluginsdir=$(pkglibdir)/plugins/

diff --git a/src/plugins/postconf.c b/src/plugins/postconf.c
index ddc8655..5a32916 100644
--- a/src/plugins/postconf.c
+++ b/src/plugins/postconf.c
@@ -392,47 +392,39 @@ void checkdms(GtkListStore *store)
return;
}

-int checkx(void)
+void write_evdev_conf(char *layout, char *variant)
{
-       char *ptr=NULL;
-       struct stat buf;
+       char *path, *ptr;
+       path = g_strdup_printf("%s/etc/X11/xorg.conf.d/10-evdev.conf", 
TARGETDIR);

-       ptr = g_strdup_printf("%s/usr/bin/xinit", TARGETDIR);
-       if(stat(ptr, &buf)) {
-               LOG("Xconfig : xinit missing");
-               return(-1);
-       }
-       free(ptr);
+       FILE *file = fopen(path, "w");
+       if(file == NULL)
+               return;

-       ptr = g_strdup_printf("%s/usr/bin/xmessage", TARGETDIR);
-       if(stat(ptr, &buf)) {
-               LOG("Xconfig : xmessage missing");
-               return(-1);
-       }
+       fprintf(file, "Section \"InputClass\"\n");
+       fprintf(file, "        Identifier \"evdev keyboard catchall\"\n");
+       fprintf(file, "        MatchIsKeyboard \"on\"\n");
+        fprintf(file, "        MatchDevicePath \"/dev/input/event*\"\n");
+       fprintf(file, "        Driver \"evdev\"\n");
+       ptr = g_strdup_printf("        Option \"xkb_layout\" \"%s\"\n", layout);
+        fprintf(file, ptr);
free(ptr);
-
-       ptr = g_strdup_printf("%s/usr/bin/xsetroot", TARGETDIR);
-       if(stat(ptr, &buf)) {
-               LOG("Xconfig : xsetroot missing");
-               return(-1);
-       }
+       ptr = g_strdup_printf("        Option \"xkb_variant\" \"%s\"\n", 
variant);
+       fprintf(file, ptr);
free(ptr);
-
-       return(0);
+       fprintf(file, "EndSection\n");
+       fclose(file);
+       free(path);
}

void x_config(GtkWidget *button, gpointer data)
{
GtkWidget* pBoite;
-       GtkWidget *pEntryRes, *pEntryDepth;
-       char* sRes = NULL, *sDepth = NULL;
-       char *mdev, *sDms, *ptr;
-       int ret;
+       char *sDms;

GtkWidget *pVBox;
GtkWidget *pFrame;
GtkWidget *pVBoxFrame;
-       GtkWidget *pLabel;
GtkWidget *image;

GtkWidget *combo;
@@ -440,12 +432,6 @@ void x_config(GtkWidget *button, gpointer data)
GtkListStore *store;
GtkTreeModel *model;

-       //* Check if all necessary x files are present *//
-       if(checkx() == -1) {
-               fwife_error(_("Corrupted X installation. Missing file, see log 
for more details"));
-               return;
-       }
-
pBoite = gtk_dialog_new_with_buttons(_("Configuring X11"),
NULL,
GTK_DIALOG_MODAL,
@@ -461,24 +447,6 @@ void x_config(GtkWidget *button, gpointer data)
image = gtk_image_new_from_file(g_strdup_printf("%s/xorg48.png", IMAGEDIR));
gtk_box_pack_start(GTK_BOX(pVBox), image, FALSE, FALSE, 0);

-       pFrame = gtk_frame_new(_("X11 Configuration"));
-       gtk_box_pack_start(GTK_BOX(pVBox), pFrame, TRUE, FALSE, 0);
-
-       pVBoxFrame = gtk_vbox_new(TRUE, 0);
-       gtk_container_add(GTK_CONTAINER(pFrame), pVBoxFrame);
-
-       pLabel = gtk_label_new(_("Resolution :"));
-       gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0);
-       pEntryRes = gtk_entry_new();
-       gtk_entry_set_text(GTK_ENTRY(pEntryRes), "1024x768");
-       gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntryRes, TRUE, FALSE, 0);
-
-       pLabel = gtk_label_new(_("Color depth :"));
-       gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0);
-       pEntryDepth = gtk_entry_new();
-       gtk_entry_set_text(GTK_ENTRY(pEntryDepth), "24");
-       gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntryDepth, TRUE, FALSE, 0);
-
pFrame = gtk_frame_new(_("Select your default display manager : "));
gtk_box_pack_start(GTK_BOX(pVBox), pFrame, TRUE, FALSE, 0);

@@ -509,55 +477,28 @@ void x_config(GtkWidget *button, gpointer data)
switch (gtk_dialog_run(GTK_DIALOG(pBoite)))
{
case GTK_RESPONSE_OK:
-                       sRes = 
strdup((char*)gtk_entry_get_text(GTK_ENTRY(pEntryRes)));
-                       sDepth = 
strdup((char*)gtk_entry_get_text(GTK_ENTRY(pEntryDepth)));
-
gtk_combo_box_get_active_iter(GTK_COMBO_BOX(combo), &iter);
model = gtk_combo_box_get_model(GTK_COMBO_BOX(combo));
gtk_tree_model_get (model, &iter, 0, &sDms, -1);

-                       if((sRes == NULL) || !strcmp(sRes, "") || (sDepth == 
NULL) || !strcmp(sDepth, "")) {
-                               free(sRes);
-                               free(sDepth);
-                               return;
-                       }
-
-                       /* copy the currently running xorg.conf in case of Xorg 
crash during configuration */
-                       copyfile("/etc/X11/xorg.conf", 
g_strdup_printf("%s/etc/X11/xorg.conf", TARGETDIR));
-
pid_t pid = fork();

if(pid == -1) {
LOG("Error when forking process (X11 config)");
} else if (pid == 0) {
chroot(TARGETDIR);
-                               mdev = fwx_get_mousedev();

//* create /sysconfig/desktop file *//
write_dms(sDms);
-
-                               if(fwx_doprobe())
-                                       exit(-1);
-
-                               fwx_doconfig(mdev, sRes, sDepth);
-                               unlink("/root/xorg.conf.new");
-                               ret = fwx_dotest();
-                               free(mdev);
-                               exit(ret);
+                               exit(0);
} else {
-                               wait(&ret);
+                               wait(NULL);

//* change keyboard localisation *//
-                               ptr = g_strdup_printf("%s/xkeybchange %s %s 
%s", SCRIPTDIR, xlayout, xvariant, TARGETDIR);
-                               fw_system(ptr);
-                               free(ptr);
+                               write_evdev_conf(xlayout, xvariant);

gtk_widget_destroy(pBoite);
-                               if(ret)
-                                       fwife_error(_("An error occurs during 
Xorg configuration.\n"
-                                             "You can try with different 
parameters or just ignore this error and continue."));
-                               else
-                                       gtk_label_set_text(GTK_LABEL(data), 
g_strdup_printf("%s %s bpp", sRes, sDepth));
+                               gtk_label_set_text(GTK_LABEL(data), "Done");
}
break;
case GTK_RESPONSE_CANCEL:
@@ -566,8 +507,6 @@ void x_config(GtkWidget *button, gpointer data)
gtk_widget_destroy(pBoite);
break;
}
-       free(sRes);
-       free(sDepth);
return;
}

@@ -633,8 +572,7 @@ int prerun(GList **config)

//* disable x configuration if no x server detected *//
ptr = g_strdup_printf("%s/usr/bin/Xorg", TARGETDIR);
-       if(!stat(ptr, &buf))
-       {
+       if(!stat(ptr, &buf)) {
gtk_widget_set_sensitive(pHBoxFrameX, TRUE);
gtk_widget_queue_draw(pHBoxFrameX);
xlayout = (char*)data_get(*config, "xlayout");
@@ -644,7 +582,7 @@ int prerun(GList **config)
// configure kernel modules
ptr = g_strdup_printf("chroot %s /sbin/depmod -a", TARGETDIR);
fw_system(ptr);
-       FREE(ptr);
+       free(ptr);

return 0;
}
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to