3 # Purpose: wrapper for startx on grml [providing new xconfiguration tool]
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2.
7 # Latest change: Don Jul 12 01:20:47 CEST 2007 [mika]
8 ################################################################################
11 # usage: DEBUG=1 grml-x ..... 2>/tmp/grml-x-debug.log
12 if [[ $DEBUG -gt 0 ]]; then
17 # functions and color {{{
18 # use colors only if not booted with nocolor bootoption
19 if ! grep -q nocolor /proc/cmdline ; then
20 autoload colors ; colors
21 [ -r /etc/grml_colors ] && . /etc/grml_colors
24 # some functions like getBootParam
25 if [ -r /etc/grml/script-functions -a -r /etc/grml/sh-lib ] ; then
26 source /etc/grml/script-functions
27 source /etc/grml/sh-lib
29 echo 'Error: sourcing function files failed. Exiting.'
33 check4root &>/dev/null && ROOT='1' || ROOT=''
38 HWINFO='/usr/sbin/hwinfo'
40 [ -n "$XINITRC" ] || XINITRC="$HOME/.xinitrc"
43 HWINFO_TMP="/tmp/hwinfo.$$"
44 MONITORINFO="/tmp/monitorinfo.$$"
45 MOUSEINFO="/tmp/mouse.$$"
47 if [ -r /etc/sysconfig/keyboard ] ; then
48 source /etc/sysconfig/keyboard
54 XCONFIG='/etc/X11/xorg.conf'
55 KEYBOARD="# Driver \"kbd\"
56 # Option \"XkbRules\" \"xfree86\"
57 # Option \"XkbRules\" \"xorg\"
58 # Option \"XkbModel\" \"pc105\"
59 # Option \"XkbLayout\" \"${XKEYBOARD},us\"
60 # Option \"XkbVariant\" \"nodeadkeys\""
63 if [ -d /usr/share/fonts/X11 ] ; then
64 XFONTS=" FontPath \"/usr/share/fonts/X11/misc\"
65 FontPath \"/usr/share/fonts/X11/100dpi/:unscaled\"
66 FontPath \"/usr/share/fonts/X11/75dpi/:unscaled\"
67 FontPath \"/usr/share/fonts/X11/Type1\"
68 FontPath \"/usr/share/fonts/X11/100dpi\"
69 FontPath \"/usr/share/fonts/X11/75dpi\""
71 # /usr/X11R6/lib/X11/fonts exists nearly everywhere, assume
72 # /usr/X11R6/lib/X11/fonts as valid font path only if fonts.dir
74 if [ -r /usr/X11R6/lib/X11/fonts/misc/fonts.dir ] ; then
76 FontPath \"/usr/X11R6/lib/X11/fonts/Type1\"
77 FontPath \"/usr/X11R6/lib/X11/fonts/misc:unscaled\"
78 FontPath \"/usr/X11R6/lib/X11/fonts/misc\"
79 FontPath \"/usr/X11R6/lib/X11/fonts/75dpi:unscaled\"
80 FontPath \"/usr/X11R6/lib/X11/fonts/75dpi\"
81 FontPath \"/usr/X11R6/lib/X11/fonts/100dpi:unscaled\"
82 FontPath \"/usr/X11R6/lib/X11/fonts/100dpi\""
86 # make sure we don't leave any temp files {{{
88 rm -f "$HWINFO_TMP" "$MONITORINFO" "$MOUSEINFO"
89 [ -n "$1" ] && EXIT="$1" || EXIT="1"
90 print "$bg[black]$fg[red]${bold_color}Exiting...${reset_color}">&2
97 # warn if running as user root {{{
98 if [ -n "$ROOT" ] ; then
99 if [ -r /etc/grml_cd ] ; then
100 print "$bg[black]$fg[red]${bold_color}Warning: Please do not run grml-x as user root.${reset_color}"
101 print "$bg[black]$fg[red]${bold_color}Running grml-x as user root is *not* supported!${reset_color}"
102 print "$bg[black]$fg[red]${bold_color}Switch to user grml or run su - grml -c 'grml-x ...' instead.${reset_color}"
105 print "$bg[black]$fg[red]${bold_color}Warning: Please do not run X.org as user root!${reset_color}"
106 print "$bg[black]$fg[red]${bold_color}As soon as you have a working $XCONFIG please use startx instead of grml-x.${reset_color}"
110 fstabuser=$(grep ':x:1000:' /etc/passwd)
111 fstabuser=${fstabuser%%[:]*}
114 # usage information {{{
117 if [[ $1 != '' ]] ; then echo 1>&2 "\n$1" ; fi
118 print "$bg[black]$fg[red]$bold_color"
121 $PROGRAMNAME [-options] windowmanager
127 $PROGRAMNAME -force -nostart fluxbox
128 $PROGRAMNAME -nosynaptics fluxbox
129 $PROGRAMNAME -nosync fluxbox
130 $PROGRAMNAME -noddc wmii
131 $PROGRAMNAME -module radeon -mode 1024x768 -vsync 60 wmi
132 XINITRC=~/.xinitrc $PROGRAMNAME ion
133 $PROGRAMNAME -display 8 wmii
135 More information on grml-x can be found in the manual page: man grml-x
137 Report bugs, send wishes and feedback to the grml team:
138 http://grml.org/bugs/ - contact (at) grml.org
140 print "${reset_color}"
148 if [ -n "$ROOT" ] ; then
149 su - $fstabuser -c "$HWINFO > $HWINFO_TMP"
151 $HWINFO > $HWINFO_TMP
159 sudo $HWINFO --monitor > $MONITORINFO
166 [ -r "$MONITORINFO" ] || monitor # get monitor settings
167 modes=$(perl -e 'while (<STDIN>) {if (/ Resolution:/) { s/.*\s+(\d+x\d+).*/$1/; print} }' < $MONITORINFO |
168 sort -nur | perl -ne 's/\s+/ /; s/(\d+x\d+)/"$1"/; print')
170 if [ -n "$XINERAMA" ] ; then
174 Option for $fg[yellow]Xinerama$fg[green] found, please use xrandr inside X.org for your further configuration!
175 Trying to identify monitors now..."
177 # make sure we have information from 2 monitors:
178 # - first one from 'hwinfo --monitor' => $MONITORINFO
179 # - second one from 'hwinfo --framebuffer' => $FRAMEBUFFER
180 FRAMEBUFFER=$(hwinfo --framebuffer | grep 'Mode 0x.* bits' | head -1)
181 if [ -z "$FRAMEBUFFER" ] ; then
183 Fatal: could not identify two monitors - no chance to
184 set up multihead using Xinerama - sorry. :-(
186 Please run grml-x without the -xinerama option to start
187 X anyway (dropping support for Xinerama of course) and
188 contact grml developers if you have any further useful
189 information. => http://grml.org/bugs/
194 # check whether we can read the $MONITORINFO file
195 if ! [ -r "$MONITORINFO" ] ; then
197 Fatal: could not identify monitor - no chance to
198 set up multihead using Xinerama - sorry. :-(
202 # Currently we only know that it works with current intel driver,
203 # so inform user about that:
204 if [[ "$MODULE" != "intel" ]] ; then
207 Warning: using a non-intel driver - trying Xinerama setup anyway.
208 If it worked please contact grml developers providing information
209 about your setup so we can adjust grml-x according!
211 -> http://grml.org/contact/
213 Sleeping for 10 seconds now... Will continue then...
214 Just press Ctrl-C to cancel operation.
219 # now calculate Virtual size for use with Xinerama
220 HORIZ_RES1="$(grep 'Max. Resolution:' $MONITORINFO | sed 's/ Max\. Resolution: \(.*\)x\(.*\)/\1/')"
221 VERIZ_RES1="$(grep 'Max. Resolution:' $MONITORINFO | sed 's/ Max\. Resolution: \(.*\)x\(.*\)/\2/')"
223 HORIZ_RES2="$(echo $FRAMEBUFFER | sed 's/ Mode 0x.*: \(.*\)x.*/\1/')"
224 VERIZ_RES2="$(echo $FRAMEBUFFER | sed 's/ Mode 0x.*x\(.*\) (.*/\1/')"
226 if [ -n "$HORIZ_RES1" -a -n "$VERIZ_RES1" -a -n "$HORIZ_RES2" ] ; then
227 if [ $(echo $VERIZ_RES1 - $VERIZ_RES2 | bc -l) -eq 0 ] ; then
228 VERIZ_RESULT="$VERIZ_RES1"
229 elif [ "$VERIZ_RES1" -gt "$VERIZ_RES2" ] ; then
230 VERIZ_RESULT="$VERIZ_RES1"
232 VERIZ_RESULT="$VERIZ_RES2"
235 HORIZ_RESULT=$(echo $HORIZ_RES1 + $HORIZ_RES2 | bc -l)
237 # important: keep newline for appropriate placing below $MODES!
238 if [ -n "$HORIZ_RESULT" ] ; then
240 Virtual $HORIZ_RESULT $VERIZ_RES1"
246 if [[ -n $NODDC ]] ; then
247 MODES="Modes \"1024x768\" \"800x600\" \"640x480\" \"1600x1200\" \"1280x1024\" \"1280x960\"$VIRTUAL"
248 elif [[ "$modes" == "\"1024x768\" " || -z $modes ]] ; then
249 MODES="# Modes \"1024x768\" \"800x600\" \"640x480\" \"1600x1200\" \"1280x1024\" \"1280x960\"$VIRTUAL"
251 MODES="# Modes $modes$VIRTUAL"
256 # sync - get hsync/vsync settings {{{
259 [ -r "$MONITORINFO" ] || monitor # get monitor settings
260 vsyncval=$(awk '/Vert. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
261 hsyncval=$(awk '/Hor. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
262 if [ -z $vsyncval ] ; then
263 vsyncval='50.0 - 60.0'
265 if [ -z $hsyncval ] ; then
266 hsyncval='28.0 - 96.0'
274 sudo $HWINFO --mouse > $MOUSEINFO
276 # SynPS/2 Synaptics TouchPad
277 if grep -q 'Device:.*Synaptics' "$MOUSEINFO" ; then
278 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
279 MOUSEDRIVER='synaptics'
280 SYNMOUSE='InputDevice "Synaptics" "AlwaysCore"'
282 Section \"InputDevice\"
284 Identifier \"Synaptics\"
285 Option \"Device\" \"/dev/psaux\"
286 Option \"Protocol\" \"auto-dev\"
287 Option \"LeftEdge\" \"1700\"
288 Option \"RightEdge\" \"5300\"
289 Option \"TopEdge\" \"1700\"
290 Option \"BottomEdge\" \"4200\"
291 Option \"FingerLow\" \"25\"
292 Option \"FingerHigh\" \"30\"
293 Option \"ZAxisMapping\" \"4 5\"
294 Option \"MaxTapTime\" \"180\"
295 Option \"MaxTapMove\" \"220\"
296 Option \"VertScrollDelta\" \"100\"
297 Option \"MinSpeed\" \"0.06\"
298 Option \"MaxSpeed\" \"0.12\"
299 Option \"AccelFactor\" \"0.0010\"
300 # Option \"SHMConfig\" \"on\"
301 # Option \"Repeater\" \"/dev/ps2mouse\"
307 SYNMOUSE='# No synaptics touchpad detected.'
311 # AlpsPS/2 ALPS TouchPad (with Synapticsdriver)
312 if grep -q 'Device:.*ALPS' "$MOUSEINFO" ; then
313 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
314 MOUSEDRIVER='synaptics'
315 SYNMOUSE='InputDevice "Synaptics" "AlwaysCore"'
317 Section \"InputDevice\"
319 Identifier \"Synaptics\"
320 Option \"Device\" \"/dev/psaux\"
321 Option \"Protocol\" \"auto-dev\"
322 Option \"LeftEdge\" \"120\"
323 Option \"RightEdge\" \"850\"
324 Option \"TopEdge\" \"120\"
325 Option \"BottomEdge\" \"650\"
326 Option \"FingerLow\" \"14\"
327 Option \"FingerHigh\" \"15\"
328 Option \"ZAxisMapping\" \"4 5\"
329 Option \"MaxTapTime\" \"180\"
330 Option \"MaxTapMove\" \"50\"
331 Option \"MaxDoubleTapTime\" \"100\"
332 Option \"VertScrollDelta\" \"20\"
333 Option \"HorizScrollDelta\" \"20\"
334 Option \"MinSpeed\" \"0.3\"
335 Option \"MaxSpeed\" \"2.00\"
336 Option \"AccelFactor\" \"0.030\"
337 Option \"UpDownScrolling\" \"1\"
338 Option \"EmulateMiddleButtonTime\" \"75\"
339 Option \"CircularScrolling\" \"1\"
340 Option \"CircScrollDelta\" \"0.1\"
341 Option \"CircScrollTrigger\" \"8\"
342 # Option \"SHMConfig\" \"on\"
343 # Option \"Repeater\" \"/dev/ps2mouse\"
349 SYNMOUSE='# No alps touchpad detected.'
352 SYNMOUSE='# No synaptics/alps touchpad present.'
356 # USB-PS/2 Optical Mouse
357 if [ -n "$USE_USB" ] ; then
358 USBMOUSE='InputDevice "USB Mouse" "CorePointer"'
360 Section \"InputDevice\"
361 Identifier \"USB Mouse\"
363 Option \"Device\" \"/dev/input/mice\"
364 Option \"Protocol\" \"auto\"
365 Option \"ZAxisMapping\" \"4 5\"
366 Option \"Buttons\" \"5\"
367 Option \"SendCoreEvents\" \"true\"
371 USBMOUSE='# InputDevice "USB Mouse" "CorePointer"'
375 if grep -q 'Device:.*Serial' "$MOUSEINFO" ; then
377 SERMOUSE='InputDevice "Serial Mouse" "CorePointer"'
379 Section \"InputDevice\"
380 Identifier \"Serial Mouse\"
382 Option \"Device\" \"/dev/ttyS0\"
383 Option \"Protocol\" \"Microsoft\"
384 Option \"Emulate3Buttons\" \"true\"
385 Option \"Emulate3Timeout\" \"70\"
386 Option \"SendCoreEvents\" \"true\"
390 SERMOUSE='# No serial mouse detected.'
394 # ImExPS/2 Logitech Explorer Mouse
395 # "PS2++ Logitech MX Mouse"
396 if [ -n "$USE_PS2" ] ; then
398 PS2MOUSE='InputDevice "PS/2 Mouse" "CorePointer"'
400 Section \"InputDevice\"
401 Identifier \"PS/2 Mouse\"
403 Option \"Device\" \"/dev/input/mice\"
404 # Option \"Device\" \"/dev/psaux\"
405 Option \"Protocol\" \"PS/2\"
406 Option \"Emulate3Buttons\" \"true\"
407 Option \"Emulate3Timeout\" \"70\"
408 Option \"SendCoreEvents\" \"true\"
412 PS2MOUSE='# InputDevice "PS/2 Mouse" "CorePointer"'
417 # Section \"InputDevice\"
418 # Identifier \"Generic Mouse\"
420 # Option \"Device\" \"/dev/input/mice\"
421 # Option \"Protocol\" \"auto\"
422 # Option \"ZAxisMapping\" \"4 5\"
423 # Option \"Buttons\" \"5\"
424 # Option \"SendCoreEvents\" \"true\"
435 # commandline parsing {{{
438 zparseopts -K -- module:=o_module help=o_help noddc=o_noddc nosync=o_nosync \
439 vsync:=o_vsync hsync:=o_hsync mode:=o_mode force=o_force display:=o_display \
440 nostart=o_nostart nodpms=o_nodpms nosynaptics=o_nosynaptics nousb=o_nousb \
441 nops2=o_nops2 genmouse=o_genmouse novref=o_novref nohsync=o_nohsync \
442 fallback=o_fallback usb=o_usb ps2=o_ps2 composite=o_composite \
445 if [[ $# == 0 || "$o_help" != "" || "$1" == '-h' || "$1" == '--help' ]]; then
449 if [[ "$o_force" != "" ]]; then
453 if [[ "$o_fallback" != "" ]]; then
455 if [ -r /etc/X11/xorg.conf.example ] ; then
456 sudo cp /etc/X11/xorg.conf.example $XCONFIG
457 print "$bold_color$fg[blue]Copying /etc/X11/xorg.conf.example to $XCONFIG as requested via fallback option."
459 echo 'Error: /etc/X11/xorg.conf.example not readable, exiting.'
464 if [[ "$o_nodpms" != "" ]]; then
465 DPMS='Option "DPMS" "false"'
467 DPMS='Option "DPMS" "true"'
470 if [[ "$o_noddc" != "" ]]; then
474 if [[ "$o_vsync" != "" ]]; then
478 if [[ "$o_hsync" != "" ]]; then
482 if [[ "$o_nousb" != "" ]]; then
483 echo 'Warning: option -nousb is deprecated.'>&2
486 if [[ "$o_usb" != "" ]]; then
490 if [[ "$o_nops2" != "" ]]; then
491 echo 'Warning: optino -nops2 is deprecatedË™'>&2
494 if [[ "$o_ps2" != "" ]]; then
498 if [[ "$o_genmouse" != "" ]]; then
502 if [[ "$o_nosynaptics" != "" ]]; then
508 if [[ "$o_nostart" != "" ]]; then
512 DISPLAY=$o_display[2]
514 eval WINDOWMANAGER=\${$#}
516 if [[ "$XKEYBOARD" == de ]] ; then
518 # Option \"XkbVariant\" \"nodeadkeys\""
521 if [ -n "$FORCE" -o ! -r "$XCONFIG" -a -z "$FALLBACK" ] ; then
522 print -n "$bold_color$fg[blue]Gathering hardware information...$fg[red]"
524 sync # get hsync/vsync
526 if [ -z "$o_hsync" ] ; then
527 o_hsync=(-hsync "$hsyncval")
529 HORIZSYNC=" HorizSync $HSYNC"
531 o_hsync=(-hsync "$o_hsync[2]")
533 HORIZSYNC=" HorizSync $HSYNC"
536 if [ -z "$o_vsync" ] ; then
537 o_vsync=(-vsync "$vsyncval")
539 VERTISYNC=" VertRefresh $VSYNC"
541 o_vsync=(-vsync "$o_vsync[2]")
543 VERTISYNC=" VertRefresh $VSYNC"
546 if [[ "$o_nosync" != "" ]]; then
547 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nosync option of grml-x"
548 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -nosync option of grml-x"
551 if [[ "$o_nohsync" != "" ]]; then
552 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nohsync option of grml-x"
555 if [[ "$o_novref" != "" ]]; then
556 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -novref option of grml-x"
559 if [[ "$o_xinerama" != "" ]]; then
563 if [[ "$o_composite" != "" ]]; then
564 COMPOSITE="Section \"Extensions\"
565 Option \"Composite\" \"Enable\"
568 COMPOSITE="#Section \"Extensions\"
569 # Option \"Composite\" \"Enable\"
577 MONITOR=$(awk '/monitor.1:/{print $3}' $HWINFO_TMP)
578 [[ $MONITOR != 'ddc' ]] && NODDC=yes
582 if [ -z "$MODULE" ] ; then
583 MODULE="$(getBootParam xmodule 2>/dev/null)"
584 if [ -z "$MODULE" ] ; then
585 MODULE=$(grep 'XFree86 v4 Server Module:' "${HWINFO_TMP}" | head -1 | awk '{print $5}')
586 if [ -z "$MODULE" ] ; then
589 # hwinfo >=13.28 reports driver 'intel' instead of i810
590 if [[ "$MODULE" == 'intel' ]] ; then
591 [ -r /usr/lib/xorg/modules/drivers/intel_drv.so ] || MODULE='i810'
598 mouse # get mouse settings
599 VGA=$(lspci | grep VGA | sed 's/.*compatible controller: //' | head -1)
602 if [ -z $MODE ] ; then
603 B_MODE="$(getBootParam xmode 2>/dev/null)"
604 if [ -n "$B_MODE" ] ; then
605 MODES="Modes \"$B_MODE\""
608 if [ -z "$MODES" ] ; then
609 mode # get available modes
612 MODES="Modes \"$MODE\""
616 print "$fg[green]done$reset_color"
617 print "$bg[black]$fg[white]$bold_color"
618 print "$fg[green]Specified windowmanager is $fg[yellow]$WINDOWMANAGER"
619 print "$fg[green]Video is $fg[yellow]$VGA$fg[green] using $bg[black]$fg[yellow]${XSERVER}$fg[cyan](${MODULE})$fg[green] Server"
620 [[ -z $HSYNC ]] && [[ -z $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR"
621 [[ -z $HSYNC ]] && [[ -n $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], VSYNC: $fg[yellow]$VSYNC"
622 [[ -z $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC"
623 [[ -n $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC $fg[green]VSYNC: $fg[yellow]$VSYNC"
624 [[ -n $modes ]] && print "$fg[green]Using default X.org modes."
625 [[ -z $modes ]] && print "$fg[green]Using Mode: $fg[yellow]$MODE"
626 print "${reset_color}"
632 # check for requirements {{{
635 if ! [ -x $(which hwinfo) ] ; then
636 print "$bg[black]$fg[red]${bold_color}Error: hwinfo not found in path.${reset_color}
637 Note: run 'apt-get install hwinfo' on systems running debian.
638 Exiting.${reset_color}"
642 if ! [[ -d /sys ]] ; then
643 print "$bg[black]$fg[red]${bold_color}Error: mounted /sys required (for hwinfo).${reset_color}
644 You may want to add the following line to your /etc/fstab:
646 sysfs /sys sysfs defaults 0 0
648 or just run 'mount /sys'. Exiting.${reset_color}"
658 ################################################################################
660 # Purpose: config file for xserver - generated by grml-x
661 # Bug-Reports: see http://grml.org/bugs/
662 # Latest change: ${DATE}
664 # /usr/share/doc/xserver-xorg/ and
665 # http://wiki.x.org/wiki/Home and
666 # http://ftp.x.org/pub/X11R7.0/doc/html/index.html for information on Xorg
667 # Refer to the xorg.conf man page and to
668 # http://ftp.x.org/pub/X11R7.0/doc/html/xorg.conf.5.html
669 # for details about the format of this file.
671 # If you would like this file to be automatically reconfigured by debian,
672 # run the following command:
673 # sudo dpkg-reconfigure -phigh xserver-xorg
674 ################################################################################
676 Section "ServerLayout"
677 Identifier "XServer Configured"
678 Screen 0 "Screen0" 0 0
679 # InputDevice "Keyboard0" "CoreKeyboard"
680 # InputDevice "Generic Mouse" "CorePointer"
684 Section "ServerFlags"
685 Option "AllowMouseOpenFail" "true" # allows the server to start up even if the mouse does not work
686 Option "DontVTSwitch" "false" # allow switching between virtual terminal
687 # Option "DontZap" "true" # disable <Crtl><Alt><BS> (server abort)
688 # Option "DontZoom" "true" # disable <Crtl><Alt><KP_+>/<KP_-> (resolution switching)
692 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/fonts.html
694 # FontPath "/usr/share/fonts/ttf/western"
695 # FontPath "/usr/share/fonts/ttf/decoratives"
696 FontPath "/usr/share/fonts/truetype/ttf-bitstream-vera"
697 FontPath "/usr/share/fonts/latex-ttf-fonts"
698 FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
701 # Modules - see /usr/X11R6/lib/modules/fonts and /usr/X11R6/lib/modules/extensions
703 Load "dbe" # double buffer extension
704 Load "dri" # direct rendering
705 Load "glx" # 3D layer / GLX extension
706 Load "type1" # type1 font module
707 Load "freetype" # freetype fonts rendering
708 Load "extmod" # some commonly used server extensions (e.g. shape extension)
709 Load "record" # recording extension
710 Load "evdev" # generic input handling driver on Linux
711 # Load "vbe" # Vesa BIOS Extension
712 # Load "i2c" # I2C bus
713 # Load "int10" # initialize graphics cards via int10 call to the BIOS
714 # Load "v4l" # Video for Linux
715 ## Deprecated/unneeded modules with Xorg >=7.0:
716 # Load "speedo" # font module (does not exist anymore)
717 # Load "ddc" # ddc probing of monitor (automatically loaded)
718 # Load "GLcore" # render OpenGL in software (automatically loaded)
719 # Load "bitmap" # bitmap fonts (automatically loaded)
720 # Valid entries - see /usr/lib/xorg/modules/[extensions/]
721 # afb bitmap cfb cfb16 cfb24 cfb32 cw damage dbe ddc dri drm extmod fb
722 # fbdevhw freetype GLcore glx i2c int10 int10 layer mfb pcidata rac ramdac
723 # record scanpci shadow shadowfb type1 vbe vgahw xaa xf1bpp xf24_32bpp xf4bpp
724 # xf8_16bpp xf8_32bpp xtrap
727 # If you'd like to switch the positions of your capslock and control keys, use:
728 # Option "XkbOptions" "ctrl:swapcaps"
729 # Or if you just want both to be control, use:
730 # Option "XkbOptions" "ctrl:nocaps"
731 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/XKB-Config.html
732 # Section "InputDevice"
733 # Identifier "Keyboard0"
734 # Option "CoreKeyboard"
736 # # Option "XkbOptions" "ctrl:swapcaps,grp:alt_shift_toggle,grp_led:scroll,compose:menu"
739 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/mouse.html
740 ${USBMOUSEDETAIL}${PS2MOUSEDETAIL}${SERMOUSEDETAIL}${SYNMOUSEDETAIL}${EVDEV_MOUSE}
742 Identifier "Monitor0"
743 # ModelName "Old Monitor (no DDC)"
745 # HorizSync 28.0 - 78.0 # Warning: This may fry very old Monitors
746 # HorizSync 28.0 - 96.0 # Warning: This may fry old Monitors
748 # VertRefresh 50.0 - 76.0 # Very conservative. May flicker.
749 # VertRefresh 50.0 - 60.0 # Extreme conservative. Will flicker. TFT default.
751 # Need more information?
752 # http://xtiming.sourceforge.net/cgi-bin/xtiming.pl
753 # http://en.tldp.org/HOWTO/XFree86-Video-Timings-HOWTO/
757 ### Available Driver options are:
758 ## sw_cursor is needed for some ati and radeon cards
767 # Option "RenderAccel" "true"
768 # Option "AllowGLXWithComposite" "true"
770 # The following line is auto-generated by grml-x
774 ## Workaround for drivers (for example radeon) which might send output to wrong device:
775 # Option "MonitorLayout" "LVDS, AUTO"
776 # Option "MonitorLayout" "LVDS, CRT"
777 # Option "MonitorLayout" "NONE, STV"
778 # Option "MonitorLayout" "LVDS"
818 # Make sure you have the relevant Debian packages on your system
819 # to be able to use DRI (libgl1-mesa-dri for example)
826 ## END OF FILE #################################################################
833 XCONFTMP="/tmp/xconfig.$$"
835 # we do not want to have two CorePointers, deactivate one therefore
836 if grep -Eq '^[[:space:]]+InputDevice[ ]+"USB Mouse"[ ]+"CorePointer"' $XCONFTMP ; then
837 if grep -Eq '^[[:space:]]+InputDevice[ ]+"PS/2 Mouse"[ ]+"CorePointer"' $XCONFTMP ; then
838 sed -i 's|InputDevice.*PS/2.*CorePointer|# & # deactivated to avoid two CorePointers|' $XCONFTMP
841 [ -f $XCONFIG ] && sudo mv -f $XCONFIG $XCONFIG.old
842 sudo mv $XCONFTMP $XCONFIG
843 sudo chown root.root $XCONFIG
844 sudo chmod 644 $XCONFIG
851 if [[ ! -f $XCONFIG ]] ; then
852 print -n "$bold_color$fg[blue]Creating $XCONFIG: $fg[red]"
853 writeit && print "$fg[green]done$reset_color"
855 if [ -z "$FORCE" -a -z "$FALLBACK" ] ; then
856 print "$bold_color$fg[blue]Notice: $XCONFIG exists already.
857 Use the force-option (-force) to force creation.
861 if [[ -n "$FORCE" ]] ; then
862 print "$bold_color$fg[blue]Force-switch or manual option(s) detected:"
863 print -n "\-> Moving eventual existing $XCONFIG to ${XCONFIG}.old: $fg[red]"
864 writeit && print "$fg[green]done$reset_color"
873 if [ -z "$NOSTART" ] ; then
875 if [ -x /etc/init.d/xorg-common ] ; then
876 sudo /etc/init.d/xorg-common start
878 if [ -x /etc/init.d/xfree86-common ] ; then
879 sudo /etc/init.d/xfree86-common start
883 if [ -z "$DISPLAY" ] ; then
884 print "$bold_color$fg[green]Now trying to run startx.$reset_color"
885 startx $XINITRC -- $XOPTS
887 print "$bold_color$fg[green]Now trying to run startx on display $DISPLAY.$reset_color"
888 startx $XINITRC -- :$DISPLAY $XOPTS
891 print "$bold_color$fg[blue]Not running startx as requested via option.$reset_color"
901 if [ -z "$ROOT" ] ; then
902 if [[ $(tty) == /dev/pts/* ]] ; then
903 print "It seems you are running $PROGRAMNAME from inside GNU screen.
904 Notice that this might fail if running as user grml!
905 Please exit screen and try to run $PROGRAMNAME again."
908 print "Run the following commands for getting information on your hardware:
910 discover -v --data-path=xfree86/server/device/driver display
911 xdebconfigurator -c -d -i -x
912 get-edid | parse-edid
914 Do you want to go the debian way of life? Run:
915 apt-get install x-window-system-core read-edid mdetect hwinfo xdebconfigurator
916 dpkg-reconfigure x-window-system-core (or xserver-xorg depending on your system)
918 Problems with the module used for X? Try to load another one or
919 fall back to module vesa:
920 $PROGRAMNAME -module radeon ...
921 $PROGRAMNAME -module vesa ...
923 Do you want to deactivate a present synaptics touchpad? Run:
924 $PROGRAMNAME -nosynaptics ...
926 Your monitor is very old and/or does not support DDC-probing?
927 $PROGRAMNAME -noddc ...
929 Do you want to create a x configuration file but do not start X?
930 $PROGRAMNAME -nostart ...
932 Monitor frequency too high or too low? Just specify hsync/vsync manually:
933 $PROGRAMNAME -hsync 30-65 ...
934 $PROGRAMNAME -hsync 30-65 -vsync 50-60 ...
936 Want to adjust the resolution? Use the mode-switch:
937 $PROGRAMNAME -mode 1024x768 ...
938 $PROGRAMNAME -mode '1280x1024 1024x768' ...
940 Problems? Use vesa with resolution 1024x768:
941 $PROGRAMNAME -module vesa -mode 1024x768 ...
943 Still problems with X? Use the fallback option:
944 $PROGRAMNAME -fallback ...
946 To adjust resolution while running X execute:
949 More information on grml-x can be found in the manual page: man grml-x
951 Report bugs, send wishes and feedback to the grml team:
952 http://grml.org/bugs/ - contact (at) grml.org
954 print -n "$reset_color"
970 if ! [ -x "$(which $WINDOWMANAGER)" ] ; then
971 print "$bg[black]$fg[red]${bold_color}Fatal: windowmanager $fg[blue]$WINDOWMANAGER$fg[red] not executable, startx won' work.${reset_color}">&2
974 if [ -w "$XINITRC" ] ; then
975 sed -i "s|^[^#]*exec.*| exec $WINDOWMANAGER|g" $XINITRC
978 echo -e "#!/bin/sh\n exec $WINDOWMANAGER" >> $XINITRC
983 ## END OF FILE #################################################################
984 # vim:foldmethod=marker expandtab ai ft=zsh