X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage4%2Fconfigure-xorg;h=1aed47f5f271957405d8ac24c466c62ce2530137;hb=44d3c1f9f0e8fc945206020c4bd7a15c5a457f55;hp=d54a806a511012a73a2ef13b77ba591c45957afd;hpb=f920c7ef750f2163b9e407cc453b192ede2c185a;p=hvlinux.git diff --git a/stage4/configure-xorg b/stage4/configure-xorg index d54a806..1aed47f 100755 --- a/stage4/configure-xorg +++ b/stage4/configure-xorg @@ -1,8 +1,6 @@ #!/bin/bash -source ../config/sysinfos -source ../functions -source ../config/packages-list +source ../functions/main # Used by startx cat > /etc/skel/.xinitrc << "EOF" @@ -11,11 +9,13 @@ cat > /etc/skel/.xinitrc << "EOF" dbus-launch --exit-with-session wmaker EOF -cat > /etc/skel/.Xdefaults << "EOF" +X_RESOURCES_FILE="Xresources" + +cat > /etc/skel/.${X_RESOURCES_FILE} << "EOF" xterm*scrollBar: false xterm*rightScrollBar: false xterm*saveLines: 1000 -xterm*geometry: 120x45+70+50 +xterm*geometry: 160x60+70+50 xterm*background: #000000 xterm*foreground: #A8A8A8 xterm*color0: #000000 @@ -42,8 +42,15 @@ cat > /etc/skel/.xsession << "EOF" userresources=$HOME/.Xresources usermodmap=$HOME/.Xmodmap -sysresources=/usr/lib/X11/xinit/.Xresources -sysmodmap=/usr/lib/X11/xinit/.Xmodmap +sysresources=/usr/lib/xorg/xdm/Xresources +sysmodmap=/etc/X11/Xmodmap + +if [ -r /etc/profile ]; then + . /etc/profile +fi +if [ -r ~/.bash_profile ]; then + . ~/.bash_profile +fi # merge in defaults and keymaps @@ -63,8 +70,10 @@ if [ -f "$usermodmap" ]; then xmodmap "$usermodmap" fi -# now, we see if xdm/gdm/kdm has asked for a specific environment +# To fix bug "Cannot open display..." when running commands as su root: +xhost +localhost +# now, we see if xdm/gdm/kdm has asked for a specific environment case $# in 1) case $1 in @@ -92,9 +101,6 @@ EOF chmod 755 /etc/skel/.xsession -cp /etc/skel/.{xinitrc,Xdefaults,xsession} /root -cp /etc/skel/.{xinitrc,Xdefaults,xsession} /home/${REGUSER} - # When needed, the X Window System creates the directory /tmp/.ICE-unix if it # does not exist. If this directory is not owned by root, the X Window System # delays startup by a few seconds and also appends a warning to the logfile. @@ -105,18 +111,6 @@ cat >> /etc/sysconfig/createfiles << "EOF" /tmp/.ICE-unix dir 1777 root root EOF -# Packages in Xorg store their configuration files in /usr/lib/X11 -# by default. This is strictly against FHS guidelines. Correct the -# installation /etc/X11 and create symlinks in the original location: -mkdir -v -p /etc/X11 - -for file in /usr/{lib/X11/{xinit,xdm},share/X11/app-defaults}; do - if [ -f ${file} -a ! -h ${file} ]; then - mv -v ${file} /etc/X11/ 2> /dev/null - ln -svfT /etc/X11/$(basename $file) $file - fi -done - if [ "x${INST_TYPE}" = "xltsp-server" ]; then # Enable remote xdm login for LTSP clients sed -i -e "s@^\(DisplayManager.requestPort.*\)@!\1@g" /etc/X11/xdm/xdm-config @@ -125,89 +119,40 @@ if [ "x${INST_TYPE}" = "xltsp-server" ]; then chmod 444 /etc/X11/xdm/Xaccess fi -# Many package are still trying to find X in /usr/X11R6. -# Until then, you can create a symbolic link to satisfy the /usr/X11R6 -# requirement so that you won't be inconvenienced with a package build -# failure due to this known issue. -#ln -scfT /usr /usr/X11R6 - -cat > /etc/X11/xorg.conf.template << "EOF" +# Header +cat > /etc/X11/xorg.conf << "EOF" # xorg.conf -# -# ********************************************************************** -# Input devices. -# ********************************************************************** -Section "InputDevice" - Identifier "Keyboard1" - Driver "keyboard" - Option "XkbRules" "xfree86" - Option "XkbModel" "pc105" - Option "XkbLayout" "_XF86_KEYBOARD_LAYOUT_" - Option "XkbVariant" "_XF86_KEYBOARD_VARIANT_" - Option "XkbOptions" "_XF86_KEYBOARD_OPTIONS_" - Option "AutoRepeat" "500 30" -EndSection -Section "InputDevice" - Identifier "Mouse1" - Driver "mouse" - Option "Emulate3Buttons" - Option "Protocol" "auto" - Option "Device" "/dev/input/mice" - Option "ZAxisMapping" "4 5" - Option "Buttons" "5" -EndSection +EOF -# ********************************************************************** -# Monitor section -# No need to specify VertRefresh and HorizSync, as DDC2 data will -# be used (if monitor is recent and supports it). -# ********************************************************************** -Section "Monitor" - Identifier "Monitor1" - VendorName "Unknown" - ModelName "Unknown" +# Keyboard section, if applicable +if [ -n ${XORG_KEYBOARD_LAYOUT} ]; then + cat >> /etc/X11/xorg.conf << "EOF" +Section "InputClass" + Identifier "Keyboard Defaults" + MatchIsKeyboard "yes" +EOF + echo "Option \"XkbLayout\" \"${XORG_KEYBOARD_LAYOUT}\"" >> /etc/X11/xorg.conf + if [ -n ${XORG_KEYBOARD_VARIANT} ]; then + echo "Option \"XkbVariant\" \"${XORG_KEYBOARD_VARIANT}\"" >> /etc/X11/xorg.conf + fi + cat >> /etc/X11/xorg.conf << "EOF" EndSection -# ********************************************************************** -# Device (video card) section -# ********************************************************************** +EOF +fi + +# Video driver section +cat >> /etc/X11/xorg.conf << "EOF" Section "Device" Identifier "VideoCard1" Driver "_VIDEO_CARD_DRIVER_" EndSection - -# ********************************************************************** -# Screen section -# ********************************************************************** -Section "Screen" - Identifier "Screen1" - Device "VideoCard1" - Monitor "Monitor1" - DefaultColorDepth 24 - Subsection "Display" - Depth 24 - Modes "1024x768" "800x600" - ViewPort 0 0 - EndSubsection -EndSection - -# ********************************************************************** -# Layout(s) section -# ********************************************************************** -Section "ServerLayout" - Identifier "Default" - Screen "Screen1" - InputDevice "Mouse1" "CorePointer" - InputDevice "Keyboard1" "CoreKeyboard" -EndSection - EOF -sed -i -e "s!_HV_FONTS_PATH_!${HV_FONTS_PATH}!g" /etc/X11/xorg.conf.template -sed -i -e "s!_VIDEO_CARD_DRIVER_!${XORG_VIDEO_DRIVER}!g" /etc/X11/xorg.conf.template -sed -i -e "s!_XF86_KEYBOARD_LAYOUT_!${HV_XF86_KEYBOARD_LAYOUT}!g" /etc/X11/xorg.conf.template -sed -i -e "s!_XF86_KEYBOARD_VARIANT_!${HV_XF86_KEYBOARD_VARIANT}!g" /etc/X11/xorg.conf.template -sed -i -e "s!_XF86_KEYBOARD_OPTIONS_!${HV_XF86_KEYBOARD_OPTIONS}!g" /etc/X11/xorg.conf.template +sed -i -e "s!_VIDEO_CARD_DRIVER_!${XORG_VIDEO_DRIVER}!g" /etc/X11/xorg.conf + +# Updating font information cache. +fc-cache -f exit $?