#!/bin/bash source ../functions/main # Used by startx cat > /etc/skel/.xinitrc << "EOF" # ~/.xinitrc dbus-launch --exit-with-session wmaker EOF X_RESOURCES_FILE="Xresources" cat > /etc/skel/.${X_RESOURCES_FILE} << "EOF" xterm*scrollBar: false xterm*rightScrollBar: false xterm*saveLines: 1000 xterm*geometry: 160x60+70+50 xterm*background: #000000 xterm*foreground: #A8A8A8 xterm*color0: #000000 xterm*color1: #A80000 xterm*color2: #00A800 xterm*color3: #A85400 xterm*color4: #0000A8 xterm*color5: #A800A8 xterm*color6: #00A8A8 xterm*color7: #A8A8A8 xterm*color8: #545054 xterm*color9: #F85450 xterm*color10: #50FC50 xterm*color11: #F2FC50 xterm*color12: #5054F8 xterm*color13: #F854F8 xterm*color14: #50FCF8 xterm*color15: #F8FCF8 EOF cat > /etc/skel/.xsession << "EOF" #!/bin/sh # ~/.xsession userresources=$HOME/.Xresources usermodmap=$HOME/.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 if [ -f $sysresources ]; then xrdb -merge $sysresources fi if [ -f $sysmodmap ]; then xmodmap $sysmodmap fi if [ -f "$userresources" ]; then xrdb -merge "$userresources" fi if [ -f "$usermodmap" ]; then xmodmap "$usermodmap" fi # 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 wmaker) exec dbus-launch --exit-with-session wmaker ;; failsafe) exec xterm -geometry 80x24-0-0 ;; default) exec dbus-launch --exit-with-session wmaker ;; *) exec dbus-launch --exit-with-session wmaker ;; esac ;; *) exec dbus-launch --exit-with-session wmaker ;; esac exit 0 EOF chmod 755 /etc/skel/.xsession # 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. # This also affects startup of other applications. To improve performance, it # is advisable to manually create the directory before the X Window System uses # it. cat >> /etc/sysconfig/createfiles << "EOF" /tmp/.ICE-unix dir 1777 root root EOF 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 chmod 644 /etc/X11/xdm/Xaccess sed -i -e "s@^#\(\*[\t ]*#any host can get a login window\)@\1@g" /etc/X11/xdm/Xaccess chmod 444 /etc/X11/xdm/Xaccess fi # Header cat > /etc/X11/xorg.conf << "EOF" # xorg.conf EOF # 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 EOF fi # Video driver section cat >> /etc/X11/xorg.conf << "EOF" Section "Device" Identifier "VideoCard1" Driver "_VIDEO_CARD_DRIVER_" EndSection EOF sed -i -e "s!_VIDEO_CARD_DRIVER_!${XORG_VIDEO_DRIVER}!g" /etc/X11/xorg.conf # Updating font information cache. fc-cache -f exit $?