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 02:53:42 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 -xinerama -composite wmii
132 $PROGRAMNAME -module radeon -mode 1024x768 -vsync 60 openbox
133 XINITRC=~/.xinitrc $PROGRAMNAME openbox
134 $PROGRAMNAME -display 8 openbox
136 More information on grml-x can be found in the manual page: man grml-x
138 Report bugs, send wishes and feedback to the grml team:
139 http://grml.org/bugs/ - contact (at) grml.org
141 print "${reset_color}"
149 if [ -n "$ROOT" ] ; then
150 su - $fstabuser -c "$HWINFO > $HWINFO_TMP"
152 $HWINFO > $HWINFO_TMP
160 sudo $HWINFO --monitor > $MONITORINFO
167 [ -r "$MONITORINFO" ] || monitor # get monitor settings
168 modes=$(perl -e 'while (<STDIN>) {if (/ Resolution:/) { s/.*\s+(\d+x\d+).*/$1/; print} }' < $MONITORINFO |
169 sort -nur | perl -ne 's/\s+/ /; s/(\d+x\d+)/"$1"/; print')
171 if [ -n "$XINERAMA" ] ; then
175 Option for $fg[yellow]Xinerama$fg[green] found, please use xrandr inside X.org for your further configuration!
176 Trying to identify monitors now..."
178 # make sure we have information from 2 monitors:
179 # - first one from 'hwinfo --monitor' => $MONITORINFO
180 # - second one from 'hwinfo --framebuffer' => $FRAMEBUFFER
181 FRAMEBUFFER=$(hwinfo --framebuffer | grep 'Mode 0x.* bits' | head -1)
182 if [ -z "$FRAMEBUFFER" ] ; then
184 Fatal: could not identify two monitors - no chance to
185 set up multihead using Xinerama - sorry. :-(
187 Please run grml-x without the -xinerama option to start
188 X anyway (dropping support for Xinerama of course) and
189 contact grml developers if you have any further useful
190 information. => http://grml.org/bugs/
195 # check whether we can read the $MONITORINFO file
196 if ! [ -r "$MONITORINFO" ] ; then
198 Fatal: could not identify monitor - no chance to
199 set up multihead using Xinerama - sorry. :-(
203 # Currently we only know that it works with current intel driver,
204 # so inform user about that:
205 if [[ "$MODULE" != "intel" ]] ; then
208 Warning: using a non-intel driver - trying Xinerama setup anyway.
209 If it worked please contact grml developers providing information
210 about your setup so we can adjust grml-x according!
212 -> http://grml.org/contact/
214 Sleeping for 10 seconds now... Will continue then...
215 Just press Ctrl-C to cancel operation.
220 # now calculate Virtual size for use with Xinerama
221 HORIZ_RES1="$(grep 'Max. Resolution:' $MONITORINFO | sed 's/ Max\. Resolution: \(.*\)x\(.*\)/\1/')"
222 VERIZ_RES1="$(grep 'Max. Resolution:' $MONITORINFO | sed 's/ Max\. Resolution: \(.*\)x\(.*\)/\2/')"
224 HORIZ_RES2="$(echo $FRAMEBUFFER | sed 's/ Mode 0x.*: \(.*\)x.*/\1/')"
225 VERIZ_RES2="$(echo $FRAMEBUFFER | sed 's/ Mode 0x.*x\(.*\) (.*/\1/')"
227 if [ -n "$HORIZ_RES1" -a -n "$VERIZ_RES1" -a -n "$HORIZ_RES2" ] ; then
228 if [ $(echo $VERIZ_RES1 - $VERIZ_RES2 | bc -l) -eq 0 ] ; then
229 VERIZ_RESULT="$VERIZ_RES1"
230 elif [ "$VERIZ_RES1" -gt "$VERIZ_RES2" ] ; then
231 VERIZ_RESULT="$VERIZ_RES1"
233 VERIZ_RESULT="$VERIZ_RES2"
236 HORIZ_RESULT=$(echo $HORIZ_RES1 + $HORIZ_RES2 | bc -l)
238 # important: keep newline for appropriate placing below $MODES!
239 if [ -n "$HORIZ_RESULT" ] ; then
241 Virtual $HORIZ_RESULT $VERIZ_RES1"
247 if [[ -n $NODDC ]] ; then
248 MODES="Modes \"1024x768\" \"800x600\" \"640x480\" \"1600x1200\" \"1280x1024\" \"1280x960\"$VIRTUAL"
249 elif [[ "$modes" == "\"1024x768\" " || -z $modes ]] ; then
250 MODES="# Modes \"1024x768\" \"800x600\" \"640x480\" \"1600x1200\" \"1280x1024\" \"1280x960\"$VIRTUAL"
252 MODES="# Modes $modes$VIRTUAL"
257 # sync - get hsync/vsync settings {{{
260 [ -r "$MONITORINFO" ] || monitor # get monitor settings
261 vsyncval=$(awk '/Vert. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
262 hsyncval=$(awk '/Hor. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
263 if [ -z $vsyncval ] ; then
264 vsyncval='50.0 - 60.0'
266 if [ -z $hsyncval ] ; then
267 hsyncval='28.0 - 96.0'
275 sudo $HWINFO --mouse > $MOUSEINFO
277 # SynPS/2 Synaptics TouchPad
278 if grep -q 'Device:.*Synaptics' "$MOUSEINFO" ; then
279 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
280 MOUSEDRIVER='synaptics'
281 SYNMOUSE='InputDevice "Synaptics" "AlwaysCore"'
283 Section \"InputDevice\"
285 Identifier \"Synaptics\"
286 Option \"Device\" \"/dev/psaux\"
287 Option \"Protocol\" \"auto-dev\"
288 Option \"LeftEdge\" \"1700\"
289 Option \"RightEdge\" \"5300\"
290 Option \"TopEdge\" \"1700\"
291 Option \"BottomEdge\" \"4200\"
292 Option \"FingerLow\" \"25\"
293 Option \"FingerHigh\" \"30\"
294 Option \"ZAxisMapping\" \"4 5\"
295 Option \"MaxTapTime\" \"180\"
296 Option \"MaxTapMove\" \"220\"
297 Option \"VertScrollDelta\" \"100\"
298 Option \"MinSpeed\" \"0.06\"
299 Option \"MaxSpeed\" \"0.12\"
300 Option \"AccelFactor\" \"0.0010\"
301 # Option \"SHMConfig\" \"on\"
302 # Option \"Repeater\" \"/dev/ps2mouse\"
308 SYNMOUSE='# No synaptics touchpad detected.'
312 # AlpsPS/2 ALPS TouchPad (with Synapticsdriver)
313 if grep -q 'Device:.*ALPS' "$MOUSEINFO" ; then
314 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
315 MOUSEDRIVER='synaptics'
316 SYNMOUSE='InputDevice "Synaptics" "AlwaysCore"'
318 Section \"InputDevice\"
320 Identifier \"Synaptics\"
321 Option \"Device\" \"/dev/psaux\"
322 Option \"Protocol\" \"auto-dev\"
323 Option \"LeftEdge\" \"120\"
324 Option \"RightEdge\" \"850\"
325 Option \"TopEdge\" \"120\"
326 Option \"BottomEdge\" \"650\"
327 Option \"FingerLow\" \"14\"
328 Option \"FingerHigh\" \"15\"
329 Option \"ZAxisMapping\" \"4 5\"
330 Option \"MaxTapTime\" \"180\"
331 Option \"MaxTapMove\" \"50\"
332 Option \"MaxDoubleTapTime\" \"100\"
333 Option \"VertScrollDelta\" \"20\"
334 Option \"HorizScrollDelta\" \"20\"
335 Option \"MinSpeed\" \"0.3\"
336 Option \"MaxSpeed\" \"2.00\"
337 Option \"AccelFactor\" \"0.030\"
338 Option \"UpDownScrolling\" \"1\"
339 Option \"EmulateMiddleButtonTime\" \"75\"
340 Option \"CircularScrolling\" \"1\"
341 Option \"CircScrollDelta\" \"0.1\"
342 Option \"CircScrollTrigger\" \"8\"
343 # Option \"SHMConfig\" \"on\"
344 # Option \"Repeater\" \"/dev/ps2mouse\"
350 SYNMOUSE='# No alps touchpad detected.'
353 SYNMOUSE='# No synaptics/alps touchpad present.'
357 # USB-PS/2 Optical Mouse
358 if [ -n "$USE_USB" ] ; then
359 USBMOUSE='InputDevice "USB Mouse" "CorePointer"'
361 Section \"InputDevice\"
362 Identifier \"USB Mouse\"
364 Option \"Device\" \"/dev/input/mice\"
365 Option \"Protocol\" \"auto\"
366 Option \"ZAxisMapping\" \"4 5\"
367 Option \"Buttons\" \"5\"
368 Option \"SendCoreEvents\" \"true\"
372 USBMOUSE='# InputDevice "USB Mouse" "CorePointer"'
376 if grep -q 'Device:.*Serial' "$MOUSEINFO" ; then
378 SERMOUSE='InputDevice "Serial Mouse" "CorePointer"'
380 Section \"InputDevice\"
381 Identifier \"Serial Mouse\"
383 Option \"Device\" \"/dev/ttyS0\"
384 Option \"Protocol\" \"Microsoft\"
385 Option \"Emulate3Buttons\" \"true\"
386 Option \"Emulate3Timeout\" \"70\"
387 Option \"SendCoreEvents\" \"true\"
391 SERMOUSE='# No serial mouse detected.'
395 # ImExPS/2 Logitech Explorer Mouse
396 # "PS2++ Logitech MX Mouse"
397 if [ -n "$USE_PS2" ] ; then
399 PS2MOUSE='InputDevice "PS/2 Mouse" "CorePointer"'
401 Section \"InputDevice\"
402 Identifier \"PS/2 Mouse\"
404 Option \"Device\" \"/dev/input/mice\"
405 # Option \"Device\" \"/dev/psaux\"
406 Option \"Protocol\" \"PS/2\"
407 Option \"Emulate3Buttons\" \"true\"
408 Option \"Emulate3Timeout\" \"70\"
409 Option \"SendCoreEvents\" \"true\"
413 PS2MOUSE='# InputDevice "PS/2 Mouse" "CorePointer"'
418 # Section \"InputDevice\"
419 # Identifier \"Generic Mouse\"
421 # Option \"Device\" \"/dev/input/mice\"
422 # Option \"Protocol\" \"auto\"
423 # Option \"ZAxisMapping\" \"4 5\"
424 # Option \"Buttons\" \"5\"
425 # Option \"SendCoreEvents\" \"true\"
436 # commandline parsing {{{
439 zparseopts -K -- module:=o_module help=o_help noddc=o_noddc nosync=o_nosync \
440 vsync:=o_vsync hsync:=o_hsync mode:=o_mode force=o_force display:=o_display \
441 nostart=o_nostart nodpms=o_nodpms nosynaptics=o_nosynaptics nousb=o_nousb \
442 nops2=o_nops2 genmouse=o_genmouse novref=o_novref nohsync=o_nohsync \
443 fallback=o_fallback usb=o_usb ps2=o_ps2 composite=o_composite \
446 if [[ $# == 0 || "$o_help" != "" || "$1" == '-h' || "$1" == '--help' ]]; then
450 if [[ "$o_force" != "" ]]; then
454 if [[ "$o_fallback" != "" ]]; then
456 if [ -r /etc/X11/xorg.conf.example ] ; then
457 sudo cp /etc/X11/xorg.conf.example $XCONFIG
458 print "$bold_color$fg[blue]Copying /etc/X11/xorg.conf.example to $XCONFIG as requested via fallback option."
460 echo 'Error: /etc/X11/xorg.conf.example not readable, exiting.'
465 if [[ "$o_nodpms" != "" ]]; then
466 DPMS='Option "DPMS" "false"'
468 DPMS='Option "DPMS" "true"'
471 if [[ "$o_noddc" != "" ]]; then
475 if [[ "$o_vsync" != "" ]]; then
479 if [[ "$o_hsync" != "" ]]; then
483 if [[ "$o_nousb" != "" ]]; then
484 echo 'Warning: option -nousb is deprecated.'>&2
487 if [[ "$o_usb" != "" ]]; then
491 if [[ "$o_nops2" != "" ]]; then
492 echo 'Warning: optino -nops2 is deprecatedË™'>&2
495 if [[ "$o_ps2" != "" ]]; then
499 if [[ "$o_genmouse" != "" ]]; then
503 if [[ "$o_nosynaptics" != "" ]]; then
509 if [[ "$o_nostart" != "" ]]; then
513 DISPLAY=$o_display[2]
515 eval WINDOWMANAGER=\${$#}
517 if [[ "$XKEYBOARD" == de ]] ; then
519 # Option \"XkbVariant\" \"nodeadkeys\""
522 if [ -n "$FORCE" -o ! -r "$XCONFIG" -a -z "$FALLBACK" ] ; then
523 print -n "$bold_color$fg[blue]Gathering hardware information...$fg[red]"
525 sync # get hsync/vsync
527 if [ -z "$o_hsync" ] ; then
528 o_hsync=(-hsync "$hsyncval")
530 HORIZSYNC=" HorizSync $HSYNC"
532 o_hsync=(-hsync "$o_hsync[2]")
534 HORIZSYNC=" HorizSync $HSYNC"
537 if [ -z "$o_vsync" ] ; then
538 o_vsync=(-vsync "$vsyncval")
540 VERTISYNC=" VertRefresh $VSYNC"
542 o_vsync=(-vsync "$o_vsync[2]")
544 VERTISYNC=" VertRefresh $VSYNC"
547 if [[ "$o_nosync" != "" ]]; then
548 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nosync option of grml-x"
549 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -nosync option of grml-x"
552 if [[ "$o_nohsync" != "" ]]; then
553 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nohsync option of grml-x"
556 if [[ "$o_novref" != "" ]]; then
557 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -novref option of grml-x"
560 if [[ "$o_xinerama" != "" ]]; then
564 if [[ "$o_composite" != "" ]]; then
565 COMPOSITE="Section \"Extensions\"
566 Option \"Composite\" \"Enable\"
569 COMPOSITE="#Section \"Extensions\"
570 # Option \"Composite\" \"Enable\"
578 MONITOR=$(awk '/monitor.1:/{print $3}' $HWINFO_TMP)
579 [[ $MONITOR != 'ddc' ]] && NODDC=yes
583 if [ -z "$MODULE" ] ; then
584 MODULE="$(getBootParam xmodule 2>/dev/null)"
585 if [ -z "$MODULE" ] ; then
586 MODULE=$(grep 'XFree86 v4 Server Module:' "${HWINFO_TMP}" | head -1 | awk '{print $5}')
587 if [ -z "$MODULE" ] ; then
590 # hwinfo >=13.28 reports driver 'intel' instead of i810
591 if [[ "$MODULE" == 'intel' ]] ; then
592 [ -r /usr/lib/xorg/modules/drivers/intel_drv.so ] || MODULE='i810'
599 mouse # get mouse settings
600 VGA=$(lspci | grep VGA | sed 's/.*compatible controller: //' | head -1)
603 if [ -z $MODE ] ; then
604 B_MODE="$(getBootParam xmode 2>/dev/null)"
605 if [ -n "$B_MODE" ] ; then
606 MODES="Modes \"$B_MODE\""
609 if [ -z "$MODES" ] ; then
610 mode # get available modes
613 MODES="Modes \"$MODE\""
617 print "$fg[green]done$reset_color"
618 print "$bg[black]$fg[white]$bold_color"
619 print "$fg[green]Specified windowmanager is $fg[yellow]$WINDOWMANAGER"
620 print "$fg[green]Video is $fg[yellow]$VGA$fg[green] using $bg[black]$fg[yellow]${XSERVER}$fg[cyan](${MODULE})$fg[green] Server"
621 [[ -z $HSYNC ]] && [[ -z $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR"
622 [[ -z $HSYNC ]] && [[ -n $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], VSYNC: $fg[yellow]$VSYNC"
623 [[ -z $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC"
624 [[ -n $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC $fg[green]VSYNC: $fg[yellow]$VSYNC"
625 [[ -n $modes ]] && print "$fg[green]Using default X.org modes."
626 [[ -z $modes ]] && print "$fg[green]Using Mode: $fg[yellow]$MODE"
627 print "${reset_color}"
633 # check for requirements {{{
636 if ! [ -x $(which hwinfo) ] ; then
637 print "$bg[black]$fg[red]${bold_color}Error: hwinfo not found in path.${reset_color}
638 Note: run 'aptitude install hwinfo' on systems running debian.
639 Exiting.${reset_color}"
643 if ! [[ -d /sys ]] ; then
644 print "$bg[black]$fg[red]${bold_color}Error: mounted /sys required (for hwinfo).${reset_color}
645 You may want to add the following line to your /etc/fstab:
647 sysfs /sys sysfs defaults 0 0
649 or just run 'mount /sys'. Exiting.${reset_color}"
659 ################################################################################
661 # Purpose: config file for xserver - generated by grml-x
662 # Bug-Reports: see http://grml.org/bugs/
663 # Latest change: ${DATE}
665 # /usr/share/doc/xserver-xorg/ and
666 # http://wiki.x.org/wiki/Home and
667 # http://ftp.x.org/pub/X11R7.0/doc/html/index.html for information on Xorg
668 # Refer to the xorg.conf man page and to
669 # http://ftp.x.org/pub/X11R7.0/doc/html/xorg.conf.5.html
670 # for details about the format of this file.
672 # If you would like this file to be automatically reconfigured by debian,
673 # run the following command:
674 # sudo dpkg-reconfigure -phigh xserver-xorg
675 ################################################################################
677 Section "ServerLayout"
678 Identifier "XServer Configured"
679 Screen 0 "Screen0" 0 0
680 # InputDevice "Keyboard0" "CoreKeyboard"
681 # InputDevice "Generic Mouse" "CorePointer"
685 Section "ServerFlags"
686 Option "AllowMouseOpenFail" "true" # allows the server to start up even if the mouse does not work
687 Option "DontVTSwitch" "false" # allow switching between virtual terminal
688 # Option "DontZap" "true" # disable <Crtl><Alt><BS> (server abort)
689 # Option "DontZoom" "true" # disable <Crtl><Alt><KP_+>/<KP_-> (resolution switching)
693 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/fonts.html
695 # FontPath "/usr/share/fonts/ttf/western"
696 # FontPath "/usr/share/fonts/ttf/decoratives"
697 FontPath "/usr/share/fonts/truetype/ttf-bitstream-vera"
698 FontPath "/usr/share/fonts/latex-ttf-fonts"
699 FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
702 # Modules - see /usr/X11R6/lib/modules/fonts and /usr/X11R6/lib/modules/extensions
704 Load "dbe" # double buffer extension
705 Load "dri" # direct rendering
706 Load "glx" # 3D layer / GLX extension
707 Load "type1" # type1 font module
708 Load "freetype" # freetype fonts rendering
709 Load "extmod" # some commonly used server extensions (e.g. shape extension)
710 Load "record" # recording extension
711 Load "evdev" # generic input handling driver on Linux
712 # Load "vbe" # Vesa BIOS Extension
713 # Load "i2c" # I2C bus
714 # Load "int10" # initialize graphics cards via int10 call to the BIOS
715 # Load "v4l" # Video for Linux
716 ## Deprecated/unneeded modules with Xorg >=7.0:
717 # Load "speedo" # font module (does not exist anymore)
718 # Load "ddc" # ddc probing of monitor (automatically loaded)
719 # Load "GLcore" # render OpenGL in software (automatically loaded)
720 # Load "bitmap" # bitmap fonts (automatically loaded)
721 # Valid entries - see /usr/lib/xorg/modules/[extensions/]
722 # afb bitmap cfb cfb16 cfb24 cfb32 cw damage dbe ddc dri drm extmod fb
723 # fbdevhw freetype GLcore glx i2c int10 int10 layer mfb pcidata rac ramdac
724 # record scanpci shadow shadowfb type1 vbe vgahw xaa xf1bpp xf24_32bpp xf4bpp
725 # xf8_16bpp xf8_32bpp xtrap
728 # If you'd like to switch the positions of your capslock and control keys, use:
729 # Option "XkbOptions" "ctrl:swapcaps"
730 # Or if you just want both to be control, use:
731 # Option "XkbOptions" "ctrl:nocaps"
732 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/XKB-Config.html
733 # Section "InputDevice"
734 # Identifier "Keyboard0"
735 # Option "CoreKeyboard"
737 # # Option "XkbOptions" "ctrl:swapcaps,grp:alt_shift_toggle,grp_led:scroll,compose:menu"
740 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/mouse.html
741 ${USBMOUSEDETAIL}${PS2MOUSEDETAIL}${SERMOUSEDETAIL}${SYNMOUSEDETAIL}${EVDEV_MOUSE}
743 Identifier "Monitor0"
744 # ModelName "Old Monitor (no DDC)"
746 # HorizSync 28.0 - 78.0 # Warning: This may fry very old Monitors
747 # HorizSync 28.0 - 96.0 # Warning: This may fry old Monitors
749 # VertRefresh 50.0 - 76.0 # Very conservative. May flicker.
750 # VertRefresh 50.0 - 60.0 # Extreme conservative. Will flicker. TFT default.
752 # Need more information?
753 # http://xtiming.sourceforge.net/cgi-bin/xtiming.pl
754 # http://en.tldp.org/HOWTO/XFree86-Video-Timings-HOWTO/
758 ### Available Driver options are:
759 ## sw_cursor is needed for some ati and radeon cards
768 # Option "RenderAccel" "true"
769 # Option "AllowGLXWithComposite" "true"
771 # The following line is auto-generated by grml-x
775 ## Workaround for drivers (for example radeon) which might send output to wrong device:
776 # Option "MonitorLayout" "LVDS, AUTO"
777 # Option "MonitorLayout" "LVDS, CRT"
778 # Option "MonitorLayout" "NONE, STV"
779 # Option "MonitorLayout" "LVDS"
819 # Make sure you have the relevant Debian packages on your system
820 # to be able to use DRI (libgl1-mesa-dri for example)
827 ## END OF FILE #################################################################
834 XCONFTMP="/tmp/xconfig.$$"
836 # we do not want to have two CorePointers, deactivate one therefore
837 if grep -Eq '^[[:space:]]+InputDevice[ ]+"USB Mouse"[ ]+"CorePointer"' $XCONFTMP ; then
838 if grep -Eq '^[[:space:]]+InputDevice[ ]+"PS/2 Mouse"[ ]+"CorePointer"' $XCONFTMP ; then
839 sed -i 's|InputDevice.*PS/2.*CorePointer|# & # deactivated to avoid two CorePointers|' $XCONFTMP
842 [ -f $XCONFIG ] && sudo mv -f $XCONFIG $XCONFIG.old
843 sudo mv $XCONFTMP $XCONFIG
844 sudo chown root.root $XCONFIG
845 sudo chmod 644 $XCONFIG
852 if [[ ! -f $XCONFIG ]] ; then
853 print -n "$bold_color$fg[blue]Creating $XCONFIG: $fg[red]"
854 writeit && print "$fg[green]done$reset_color"
856 if [ -z "$FORCE" -a -z "$FALLBACK" ] ; then
857 print "$bold_color$fg[blue]Notice: $XCONFIG exists already.
858 Use the force-option (-force) to force creation.
862 if [[ -n "$FORCE" ]] ; then
863 print "$bold_color$fg[blue]Force-switch or manual option(s) detected:"
864 print -n "\-> Moving eventual existing $XCONFIG to ${XCONFIG}.old: $fg[red]"
865 writeit && print "$fg[green]done$reset_color"
874 if [ -z "$NOSTART" ] ; then
876 if [ -x /etc/init.d/xorg-common ] ; then
877 sudo /etc/init.d/xorg-common start
879 if [ -x /etc/init.d/xfree86-common ] ; then
880 sudo /etc/init.d/xfree86-common start
884 if [ -z "$DISPLAY" ] ; then
885 print "$bold_color$fg[green]Now trying to run startx.$reset_color"
886 startx $XINITRC -- $XOPTS
888 print "$bold_color$fg[green]Now trying to run startx on display $DISPLAY.$reset_color"
889 startx $XINITRC -- :$DISPLAY $XOPTS
892 print "$bold_color$fg[blue]Not running startx as requested via option.$reset_color"
902 if [ -z "$ROOT" ] ; then
903 if [[ $(tty) == /dev/pts/* ]] ; then
904 print "It seems you are running $PROGRAMNAME from inside GNU screen.
905 Notice that this might fail if running as user grml!
906 Please exit screen and try to run $PROGRAMNAME again."
909 print "Run the following commands for getting information on your hardware:
911 discover -v --data-path=xfree86/server/device/driver display
912 xdebconfigurator -c -d -i -x
913 get-edid | parse-edid
915 Do you want to go the debian way of life? Run:
916 aptitude install xorg read-edid mdetect hwinfo xdebconfigurator
917 dpkg-reconfigure -phigh xserver-xorg
919 Problems with the module used for X? Try to load another one or
920 fall back to module vesa:
921 $PROGRAMNAME -module radeon ...
922 $PROGRAMNAME -module vesa ...
924 Do you want to deactivate a present synaptics touchpad? Run:
925 $PROGRAMNAME -nosynaptics ...
927 Your monitor is very old and/or does not support DDC-probing?
928 $PROGRAMNAME -noddc ...
930 Do you want to create a x configuration file but do not start X?
931 $PROGRAMNAME -nostart ...
933 Monitor frequency too high or too low? Just specify hsync/vsync manually:
934 $PROGRAMNAME -hsync 30-65 ...
935 $PROGRAMNAME -hsync 30-65 -vsync 50-60 ...
937 Want to adjust the resolution? Use the mode-switch:
938 $PROGRAMNAME -mode 1024x768 ...
939 $PROGRAMNAME -mode '1280x1024 1024x768' ...
941 Problems? Use vesa with resolution 1024x768:
942 $PROGRAMNAME -module vesa -mode 1024x768 ...
944 Still problems with X? Use the fallback option:
945 $PROGRAMNAME -fallback ...
947 To adjust resolution while running X execute:
950 More information on grml-x can be found in the manual page: man grml-x
952 Report bugs, send wishes and feedback to the grml team:
953 http://grml.org/bugs/ - contact (at) grml.org
955 print -n "$reset_color"
971 if ! [ -x "$(which $WINDOWMANAGER)" ] ; then
972 print "$bg[black]$fg[red]${bold_color}Fatal: windowmanager $fg[blue]$WINDOWMANAGER$fg[red] not executable, startx won' work.${reset_color}">&2
975 if [ -w "$XINITRC" ] ; then
976 sed -i "s|^[^#]*exec.*| exec $WINDOWMANAGER|g" $XINITRC
979 echo -e "#!/bin/sh\n exec $WINDOWMANAGER" >> $XINITRC
984 ## END OF FILE #################################################################
985 # vim:foldmethod=marker expandtab ai ft=zsh