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
669 # Refer to the xorg.conf man page and to
670 # http://ftp.x.org/pub/X11R7.0/doc/html/xorg.conf.5.html
671 # for details about the format of this file.
673 # See http://wiki.debian.org/XStrikeForce/FAQ for information
674 # regarding Xorg packages within Debian.
676 # If you would like this file to be automatically reconfigured by debian,
677 # run the following command:
678 # sudo dpkg-reconfigure -phigh xserver-xorg
679 ################################################################################
681 Section "ServerLayout"
682 Identifier "XServer Configured"
683 Screen 0 "Screen0" 0 0
684 # InputDevice "Keyboard0" "CoreKeyboard"
685 # InputDevice "Generic Mouse" "CorePointer"
689 Section "ServerFlags"
690 Option "AllowMouseOpenFail" "true" # allows the server to start up even if the mouse does not work
691 Option "DontVTSwitch" "false" # allow switching between virtual terminal
692 # Option "DontZap" "true" # disable <Crtl><Alt><BS> (server abort)
693 # Option "DontZoom" "true" # disable <Crtl><Alt><KP_+>/<KP_-> (resolution switching)
697 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/fonts.html
699 # FontPath "/usr/share/fonts/ttf/western"
700 # FontPath "/usr/share/fonts/ttf/decoratives"
701 FontPath "/usr/share/fonts/truetype/ttf-bitstream-vera"
702 FontPath "/usr/share/fonts/latex-ttf-fonts"
703 FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
706 # Modules - see /usr/X11R6/lib/modules/fonts and /usr/X11R6/lib/modules/extensions
708 Load "dbe" # double buffer extension
709 Load "dri" # direct rendering
710 Load "glx" # 3D layer / GLX extension
711 Load "type1" # type1 font module
712 Load "freetype" # freetype fonts rendering
713 Load "extmod" # some commonly used server extensions (e.g. shape extension)
714 Load "record" # recording extension
715 Load "evdev" # generic input handling driver on Linux
716 # Load "vbe" # Vesa BIOS Extension
717 # Load "i2c" # I2C bus
718 # Load "int10" # initialize graphics cards via int10 call to the BIOS
719 # Load "v4l" # Video for Linux
720 ## Deprecated/unneeded modules with Xorg >=7.0:
721 # Load "speedo" # font module (does not exist anymore)
722 # Load "ddc" # ddc probing of monitor (automatically loaded)
723 # Load "GLcore" # render OpenGL in software (automatically loaded)
724 # Load "bitmap" # bitmap fonts (automatically loaded)
725 # Valid entries - see /usr/lib/xorg/modules/[extensions/]
726 # afb bitmap cfb cfb16 cfb24 cfb32 cw damage dbe ddc dri drm extmod fb
727 # fbdevhw freetype GLcore glx i2c int10 int10 layer mfb pcidata rac ramdac
728 # record scanpci shadow shadowfb type1 vbe vgahw xaa xf1bpp xf24_32bpp xf4bpp
729 # xf8_16bpp xf8_32bpp xtrap
732 # If you'd like to switch the positions of your capslock and control keys, use:
733 # Option "XkbOptions" "ctrl:swapcaps"
734 # Or if you just want both to be control, use:
735 # Option "XkbOptions" "ctrl:nocaps"
736 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/XKB-Config.html
737 # Section "InputDevice"
738 # Identifier "Keyboard0"
739 # Option "CoreKeyboard"
741 # # Option "XkbOptions" "ctrl:swapcaps,grp:alt_shift_toggle,grp_led:scroll,compose:menu"
744 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/mouse.html
745 ${USBMOUSEDETAIL}${PS2MOUSEDETAIL}${SERMOUSEDETAIL}${SYNMOUSEDETAIL}${EVDEV_MOUSE}
747 Identifier "Monitor0"
748 # ModelName "Old Monitor (no DDC)"
750 # HorizSync 28.0 - 78.0 # Warning: This may fry very old Monitors
751 # HorizSync 28.0 - 96.0 # Warning: This may fry old Monitors
753 # VertRefresh 50.0 - 76.0 # Very conservative. May flicker.
754 # VertRefresh 50.0 - 60.0 # Extreme conservative. Will flicker. TFT default.
756 # Need more information?
757 # http://xtiming.sourceforge.net/cgi-bin/xtiming.pl
758 # http://en.tldp.org/HOWTO/XFree86-Video-Timings-HOWTO/
762 ### Available Driver options are:
763 ## sw_cursor is needed for some ati and radeon cards
772 # Option "RenderAccel" "true"
773 # Option "AllowGLXWithComposite" "true"
775 # The following line is auto-generated by grml-x
779 ## Workaround for drivers (for example radeon) which might send output to wrong device:
780 # Option "MonitorLayout" "LVDS, AUTO"
781 # Option "MonitorLayout" "LVDS, CRT"
782 # Option "MonitorLayout" "NONE, STV"
783 # Option "MonitorLayout" "LVDS"
823 # Make sure you have the relevant Debian packages on your system
824 # to be able to use DRI (libgl1-mesa-dri for example)
831 ## END OF FILE #################################################################
838 XCONFTMP="/tmp/xconfig.$$"
840 # we do not want to have two CorePointers, deactivate one therefore
841 if grep -Eq '^[[:space:]]+InputDevice[ ]+"USB Mouse"[ ]+"CorePointer"' $XCONFTMP ; then
842 if grep -Eq '^[[:space:]]+InputDevice[ ]+"PS/2 Mouse"[ ]+"CorePointer"' $XCONFTMP ; then
843 sed -i 's|InputDevice.*PS/2.*CorePointer|# & # deactivated to avoid two CorePointers|' $XCONFTMP
846 [ -f $XCONFIG ] && sudo mv -f $XCONFIG $XCONFIG.old
847 sudo mv $XCONFTMP $XCONFIG
848 sudo chown root.root $XCONFIG
849 sudo chmod 644 $XCONFIG
856 if [[ ! -f $XCONFIG ]] ; then
857 print -n "$bold_color$fg[blue]Creating $XCONFIG: $fg[red]"
858 writeit && print "$fg[green]done$reset_color"
860 if [ -z "$FORCE" -a -z "$FALLBACK" ] ; then
861 print "$bold_color$fg[blue]Notice: $XCONFIG exists already.
862 Use the force-option (-force) to force creation.
866 if [[ -n "$FORCE" ]] ; then
867 print "$bold_color$fg[blue]Force-switch or manual option(s) detected:"
868 print -n "\-> Moving eventual existing $XCONFIG to ${XCONFIG}.old: $fg[red]"
869 writeit && print "$fg[green]done$reset_color"
878 if [ -z "$NOSTART" ] ; then
880 if [ -x /etc/init.d/xorg-common ] ; then
881 sudo /etc/init.d/xorg-common start
883 if [ -x /etc/init.d/xfree86-common ] ; then
884 sudo /etc/init.d/xfree86-common start
888 if [ -z "$DISPLAY" ] ; then
889 print "$bold_color$fg[green]Now trying to run startx.$reset_color"
890 startx $XINITRC -- $XOPTS
892 print "$bold_color$fg[green]Now trying to run startx on display $DISPLAY.$reset_color"
893 startx $XINITRC -- :$DISPLAY $XOPTS
896 print "$bold_color$fg[blue]Not running startx as requested via option.$reset_color"
906 if [ -z "$ROOT" ] ; then
907 if [[ $(tty) == /dev/pts/* ]] ; then
908 print "It seems you are running $PROGRAMNAME from inside GNU screen.
909 Notice that this might fail if running as user grml!
910 Please exit screen and try to run $PROGRAMNAME again."
913 print "Run the following commands for getting information on your hardware:
915 discover -v --data-path=xfree86/server/device/driver display
916 xdebconfigurator -c -d -i -x
917 get-edid | parse-edid
919 Do you want to go the debian way of life? Run:
920 aptitude install xorg read-edid mdetect hwinfo xdebconfigurator
921 dpkg-reconfigure -phigh xserver-xorg
923 Problems with the module used for X? Try to load another one or
924 fall back to module vesa:
925 $PROGRAMNAME -module radeon ...
926 $PROGRAMNAME -module vesa ...
928 Do you want to deactivate a present synaptics touchpad? Run:
929 $PROGRAMNAME -nosynaptics ...
931 Your monitor is very old and/or does not support DDC-probing?
932 $PROGRAMNAME -noddc ...
934 Do you want to create a x configuration file but do not start X?
935 $PROGRAMNAME -nostart ...
937 Monitor frequency too high or too low? Just specify hsync/vsync manually:
938 $PROGRAMNAME -hsync 30-65 ...
939 $PROGRAMNAME -hsync 30-65 -vsync 50-60 ...
941 Want to adjust the resolution? Use the mode-switch:
942 $PROGRAMNAME -mode 1024x768 ...
943 $PROGRAMNAME -mode '1280x1024 1024x768' ...
945 Problems? Use vesa with resolution 1024x768:
946 $PROGRAMNAME -module vesa -mode 1024x768 ...
948 Still problems with X? Use the fallback option:
949 $PROGRAMNAME -fallback ...
951 To adjust resolution while running X execute:
954 More information on grml-x can be found in the manual page: man grml-x
956 Report bugs, send wishes and feedback to the grml team:
957 http://grml.org/bugs/ - contact (at) grml.org
959 print -n "$reset_color"
975 if ! [ -x "$(which $WINDOWMANAGER)" ] ; then
976 print "$bg[black]$fg[red]${bold_color}Fatal: windowmanager $fg[blue]$WINDOWMANAGER$fg[red] not executable, startx won' work.${reset_color}">&2
979 if [ -w "$XINITRC" ] ; then
980 sed -i "s|^[^#]*exec.*| exec $WINDOWMANAGER|g" $XINITRC
983 echo -e "#!/bin/sh\n exec $WINDOWMANAGER" >> $XINITRC
988 ## END OF FILE #################################################################
989 # vim:foldmethod=marker expandtab ai ft=zsh