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 # Currently we only know that it works with current intel driver,
178 # so inform user about that:
179 if [[ "$MODULE" != "intel" ]] ; then
182 Warning: using a non-intel driver - trying Xinerama setup anyway.
183 If it worked please contact grml developers providing information
184 about your setup so we can adjust grml-x according!
186 -> http://grml.org/contact/
188 Sleeping for 10 seconds now... Will continue then...
189 Just press Ctrl-C to cancel operation.
194 # make sure we have information from 2 monitors:
195 # - first one from 'hwinfo --monitor' => $MONITORINFO
196 # - second one from 'hwinfo --framebuffer' => $FRAMEBUFFER
197 FRAMEBUFFER=$(hwinfo --framebuffer | grep 'Mode 0x.* bits' | head -1)
198 if [ -z "$FRAMEBUFFER" ] ; then
200 Fatal: could not identify two monitors - no chance to
201 set up multihead using Xinerama - sorry. :-(
203 Please run grml-x without the -xinerama option and contact
204 grml developers if you have any further useful information.
205 => http://grml.org/bugs/
210 # check whether we can read the $MONITORINFO file
211 if ! [ -r "$MONITORINFO" ] ; then
213 Fatal: could not identify monitor - no chance to
214 set up multihead using Xinerama - sorry. :-(
218 # now calculate Virtual size for use with Xinerama
219 HORIZ_RES1="$(grep 'Max. Resolution:' $MONITORINFO | sed 's/ Max\. Resolution: \(.*\)x\(.*\)/\1/')"
220 VERIZ_RES1="$(grep 'Max. Resolution:' $MONITORINFO | sed 's/ Max\. Resolution: \(.*\)x\(.*\)/\2/')"
222 HORIZ_RES2="$(echo $FRAMEBUFFER | sed 's/ Mode 0x.*: \(.*\)x.*/\1/')"
223 VERIZ_RES2="$(echo $FRAMEBUFFER | sed 's/ Mode 0x.*x\(.*\) (.*/\1/')"
225 if [ -n "$HORIZ_RES1" -a -n "$VERIZ_RES1" -a -n "$HORIZ_RES2" ] ; then
226 if [ $(echo $VERIZ_RES1 - $VERIZ_RES2 | bc -l) -eq 0 ] ; then
227 VERIZ_RESULT="$VERIZ_RES1"
228 elif [ "$VERIZ_RES1" -gt "$VERIZ_RES2" ] ; then
229 VERIZ_RESULT="$VERIZ_RES1"
231 VERIZ_RESULT="$VERIZ_RES2"
234 HORIZ_RESULT=$(echo $HORIZ_RES1 + $HORIZ_RES2 | bc -l)
236 # important: keep newline for appropriate placing below $MODES!
237 if [ -n "$HORIZ_RESULT" ] ; then
239 Virtual $HORIZ_RESULT $VERIZ_RES1"
245 if [[ -n $NODDC ]] ; then
246 MODES="Modes \"1024x768\" \"800x600\" \"640x480\" \"1600x1200\" \"1280x1024\" \"1280x960\"$VIRTUAL"
247 elif [[ "$modes" == "\"1024x768\" " || -z $modes ]] ; then
248 MODES="# Modes \"1024x768\" \"800x600\" \"640x480\" \"1600x1200\" \"1280x1024\" \"1280x960\"$VIRTUAL"
250 MODES="# Modes $modes$VIRTUAL"
255 # sync - get hsync/vsync settings {{{
258 [ -r "$MONITORINFO" ] || monitor # get monitor settings
259 vsyncval=$(awk '/Vert. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
260 hsyncval=$(awk '/Hor. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
261 if [ -z $vsyncval ] ; then
262 vsyncval='50.0 - 60.0'
264 if [ -z $hsyncval ] ; then
265 hsyncval='28.0 - 96.0'
273 sudo $HWINFO --mouse > $MOUSEINFO
275 # SynPS/2 Synaptics TouchPad
276 if grep -q 'Device:.*Synaptics' "$MOUSEINFO" ; then
277 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
278 MOUSEDRIVER='synaptics'
279 SYNMOUSE='InputDevice "Synaptics" "AlwaysCore"'
281 Section \"InputDevice\"
283 Identifier \"Synaptics\"
284 Option \"Device\" \"/dev/psaux\"
285 Option \"Protocol\" \"auto-dev\"
286 Option \"LeftEdge\" \"1700\"
287 Option \"RightEdge\" \"5300\"
288 Option \"TopEdge\" \"1700\"
289 Option \"BottomEdge\" \"4200\"
290 Option \"FingerLow\" \"25\"
291 Option \"FingerHigh\" \"30\"
292 Option \"ZAxisMapping\" \"4 5\"
293 Option \"MaxTapTime\" \"180\"
294 Option \"MaxTapMove\" \"220\"
295 Option \"VertScrollDelta\" \"100\"
296 Option \"MinSpeed\" \"0.06\"
297 Option \"MaxSpeed\" \"0.12\"
298 Option \"AccelFactor\" \"0.0010\"
299 # Option \"SHMConfig\" \"on\"
300 # Option \"Repeater\" \"/dev/ps2mouse\"
306 SYNMOUSE='# No synaptics touchpad detected.'
310 # AlpsPS/2 ALPS TouchPad (with Synapticsdriver)
311 if grep -q 'Device:.*ALPS' "$MOUSEINFO" ; then
312 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
313 MOUSEDRIVER='synaptics'
314 SYNMOUSE='InputDevice "Synaptics" "AlwaysCore"'
316 Section \"InputDevice\"
318 Identifier \"Synaptics\"
319 Option \"Device\" \"/dev/psaux\"
320 Option \"Protocol\" \"auto-dev\"
321 Option \"LeftEdge\" \"120\"
322 Option \"RightEdge\" \"850\"
323 Option \"TopEdge\" \"120\"
324 Option \"BottomEdge\" \"650\"
325 Option \"FingerLow\" \"14\"
326 Option \"FingerHigh\" \"15\"
327 Option \"ZAxisMapping\" \"4 5\"
328 Option \"MaxTapTime\" \"180\"
329 Option \"MaxTapMove\" \"50\"
330 Option \"MaxDoubleTapTime\" \"100\"
331 Option \"VertScrollDelta\" \"20\"
332 Option \"HorizScrollDelta\" \"20\"
333 Option \"MinSpeed\" \"0.3\"
334 Option \"MaxSpeed\" \"2.00\"
335 Option \"AccelFactor\" \"0.030\"
336 Option \"UpDownScrolling\" \"1\"
337 Option \"EmulateMiddleButtonTime\" \"75\"
338 Option \"CircularScrolling\" \"1\"
339 Option \"CircScrollDelta\" \"0.1\"
340 Option \"CircScrollTrigger\" \"8\"
341 # Option \"SHMConfig\" \"on\"
342 # Option \"Repeater\" \"/dev/ps2mouse\"
348 SYNMOUSE='# No alps touchpad detected.'
351 SYNMOUSE='# No synaptics/alps touchpad present.'
355 # USB-PS/2 Optical Mouse
356 if [ -n "$USE_USB" ] ; then
357 USBMOUSE='InputDevice "USB Mouse" "CorePointer"'
359 Section \"InputDevice\"
360 Identifier \"USB Mouse\"
362 Option \"Device\" \"/dev/input/mice\"
363 Option \"Protocol\" \"auto\"
364 Option \"ZAxisMapping\" \"4 5\"
365 Option \"Buttons\" \"5\"
366 Option \"SendCoreEvents\" \"true\"
370 USBMOUSE='# InputDevice "USB Mouse" "CorePointer"'
374 if grep -q 'Device:.*Serial' "$MOUSEINFO" ; then
376 SERMOUSE='InputDevice "Serial Mouse" "CorePointer"'
377 SERMOUSEDETAIL="Section \"InputDevice\"
378 Identifier \"Serial Mouse\"
380 Option \"Device\" \"/dev/ttyS0\"
381 Option \"Protocol\" \"Microsoft\"
382 Option \"Emulate3Buttons\" \"true\"
383 Option \"Emulate3Timeout\" \"70\"
384 Option \"SendCoreEvents\" \"true\"
388 SERMOUSE='# No serial mouse detected.'
392 # ImExPS/2 Logitech Explorer Mouse
393 # "PS2++ Logitech MX Mouse"
394 if [ -n "$USE_PS2" ] ; then
396 PS2MOUSE='InputDevice "PS/2 Mouse" "CorePointer"'
397 PS2MOUSEDETAIL="Section \"InputDevice\"
398 Identifier \"PS/2 Mouse\"
400 Option \"Device\" \"/dev/input/mice\"
401 # Option \"Device\" \"/dev/psaux\"
402 Option \"Protocol\" \"PS/2\"
403 Option \"Emulate3Buttons\" \"true\"
404 Option \"Emulate3Timeout\" \"70\"
405 Option \"SendCoreEvents\" \"true\"
409 PS2MOUSE='# InputDevice "PS/2 Mouse" "CorePointer"'
413 EVDEV_MOUSE="# Section \"InputDevice\"
414 # Identifier \"Generic Mouse\"
416 # Option \"Device\" \"/dev/input/mice\"
417 # Option \"Protocol\" \"auto\"
418 # Option \"ZAxisMapping\" \"4 5\"
419 # Option \"Buttons\" \"5\"
420 # Option \"SendCoreEvents\" \"true\"
431 # commandline parsing {{{
434 zparseopts -K -- module:=o_module help=o_help noddc=o_noddc nosync=o_nosync \
435 vsync:=o_vsync hsync:=o_hsync mode:=o_mode force=o_force display:=o_display \
436 nostart=o_nostart nodpms=o_nodpms nosynaptics=o_nosynaptics nousb=o_nousb \
437 nops2=o_nops2 genmouse=o_genmouse novref=o_novref nohsync=o_nohsync \
438 fallback=o_fallback usb=o_usb ps2=o_ps2 composite=o_composite \
441 if [[ $# == 0 || "$o_help" != "" || "$1" == '-h' || "$1" == '--help' ]]; then
445 if [[ "$o_force" != "" ]]; then
449 if [[ "$o_fallback" != "" ]]; then
451 if [ -r /etc/X11/xorg.conf.example ] ; then
452 sudo cp /etc/X11/xorg.conf.example $XCONFIG
453 print "$bold_color$fg[blue]Copying /etc/X11/xorg.conf.example to $XCONFIG as requested via fallback option."
455 echo 'Error: /etc/X11/xorg.conf.example not readable, exiting.'
460 if [[ "$o_nodpms" != "" ]]; then
461 DPMS='Option "DPMS" "false"'
463 DPMS='Option "DPMS" "true"'
466 if [[ "$o_noddc" != "" ]]; then
470 if [[ "$o_vsync" != "" ]]; then
474 if [[ "$o_hsync" != "" ]]; then
478 if [[ "$o_nousb" != "" ]]; then
479 echo 'Warning: option -nousb is deprecated.'>&2
482 if [[ "$o_usb" != "" ]]; then
486 if [[ "$o_nops2" != "" ]]; then
487 echo 'Warning: optino -nops2 is deprecatedË™'>&2
490 if [[ "$o_ps2" != "" ]]; then
494 if [[ "$o_genmouse" != "" ]]; then
498 if [[ "$o_nosynaptics" != "" ]]; then
504 if [[ "$o_nostart" != "" ]]; then
508 DISPLAY=$o_display[2]
510 eval WINDOWMANAGER=\${$#}
512 if [[ "$XKEYBOARD" == de ]] ; then
514 # Option \"XkbVariant\" \"nodeadkeys\""
517 if [ -n "$FORCE" -o ! -r "$XCONFIG" -a -z "$FALLBACK" ] ; then
518 print -n "$bold_color$fg[blue]Gathering hardware information...$fg[red]"
520 sync # get hsync/vsync
522 if [ -z "$o_hsync" ] ; then
523 o_hsync=(-hsync "$hsyncval")
525 HORIZSYNC=" HorizSync $HSYNC"
527 o_hsync=(-hsync "$o_hsync[2]")
529 HORIZSYNC=" HorizSync $HSYNC"
532 if [ -z "$o_vsync" ] ; then
533 o_vsync=(-vsync "$vsyncval")
535 VERTISYNC=" VertRefresh $VSYNC"
537 o_vsync=(-vsync "$o_vsync[2]")
539 VERTISYNC=" VertRefresh $VSYNC"
542 if [[ "$o_nosync" != "" ]]; then
543 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nosync option of grml-x"
544 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -nosync option of grml-x"
547 if [[ "$o_nohsync" != "" ]]; then
548 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nohsync option of grml-x"
551 if [[ "$o_novref" != "" ]]; then
552 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -novref option of grml-x"
555 if [[ "$o_xinerama" != "" ]]; then
559 if [[ "$o_composite" != "" ]]; then
560 COMPOSITE="Section \"Extensions\"
561 Option \"Composite\" \"Enable\"
564 COMPOSITE="#Section \"Extensions\"
565 # Option \"Composite\" \"Enable\"
573 MONITOR=$(awk '/monitor.1:/{print $3}' $HWINFO_TMP)
574 [[ $MONITOR != 'ddc' ]] && NODDC=yes
578 if [ -z "$MODULE" ] ; then
579 MODULE="$(getBootParam xmodule 2>/dev/null)"
580 if [ -z "$MODULE" ] ; then
581 MODULE=$(grep 'XFree86 v4 Server Module:' "${HWINFO_TMP}" | head -1 | awk '{print $5}')
582 if [ -z "$MODULE" ] ; then
585 # hwinfo >=13.28 reports driver 'intel' instead of i810
586 if [[ "$MODULE" == 'intel' ]] ; then
587 [ -r /usr/lib/xorg/modules/drivers/intel_drv.so ] || MODULE='i810'
594 mouse # get mouse settings
595 VGA=$(lspci | grep VGA | sed 's/.*compatible controller: //' | head -1)
598 if [ -z $MODE ] ; then
599 B_MODE="$(getBootParam xmode 2>/dev/null)"
600 if [ -n "$B_MODE" ] ; then
601 MODES="Modes \"$B_MODE\""
604 if [ -z "$MODES" ] ; then
605 mode # get available modes
608 MODES="Modes \"$MODE\""
612 print "$fg[green]done$reset_color"
613 print "$bg[black]$fg[white]$bold_color"
614 print "$fg[green]Specified windowmanager is $fg[yellow]$WINDOWMANAGER"
615 print "$fg[green]Video is $fg[yellow]$VGA$fg[green] using $bg[black]$fg[yellow]${XSERVER}$fg[cyan](${MODULE})$fg[green] Server"
616 [[ -z $HSYNC ]] && [[ -z $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR"
617 [[ -z $HSYNC ]] && [[ -n $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], VSYNC: $fg[yellow]$VSYNC"
618 [[ -z $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC"
619 [[ -n $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC $fg[green]VSYNC: $fg[yellow]$VSYNC"
620 [[ -n $modes ]] && print "$fg[green]Using default X.org modes."
621 [[ -z $modes ]] && print "$fg[green]Using Mode: $fg[yellow]$MODE"
622 print "${reset_color}"
628 # check for requirements {{{
631 if ! [ -x $(which hwinfo) ] ; then
632 print "$bg[black]$fg[red]${bold_color}Error: hwinfo not found in path.${reset_color}
633 Note: run 'apt-get install hwinfo' on systems running debian.
634 Exiting.${reset_color}"
638 if ! [[ -d /sys ]] ; then
639 print "$bg[black]$fg[red]${bold_color}Error: mounted /sys required (for hwinfo).${reset_color}
640 You may want to add the following line to your /etc/fstab:
642 sysfs /sys sysfs defaults 0 0
644 or just run 'mount /sys'. Exiting.${reset_color}"
654 ################################################################################
656 # Purpose: config file for xserver - generated by grml-x
657 # Bug-Reports: see http://grml.org/bugs/
658 # Latest change: ${DATE}
660 # /usr/share/doc/xserver-xorg/ and
661 # http://wiki.x.org/wiki/Home and
662 # http://ftp.x.org/pub/X11R7.0/doc/html/index.html for information on Xorg
663 # Refer to the xorg.conf man page and to
664 # http://ftp.x.org/pub/X11R7.0/doc/html/xorg.conf.5.html
665 # for details about the format of this file.
667 # If you would like this file to be automatically reconfigured by debian,
668 # run the following command:
669 # sudo dpkg-reconfigure -phigh xserver-xorg
670 ################################################################################
672 Section "ServerLayout"
673 Identifier "XServer Configured"
674 Screen 0 "Screen0" 0 0
675 # InputDevice "Keyboard0" "CoreKeyboard"
676 # InputDevice "Generic Mouse" "CorePointer"
680 Section "ServerFlags"
681 Option "AllowMouseOpenFail" "true" # allows the server to start up even if the mouse does not work
682 Option "DontVTSwitch" "false" # allow switching between virtual terminal
683 # Option "DontZap" "true" # disable <Crtl><Alt><BS> (server abort)
684 # Option "DontZoom" "true" # disable <Crtl><Alt><KP_+>/<KP_-> (resolution switching)
688 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/fonts.html
690 # FontPath "/usr/share/fonts/ttf/western"
691 # FontPath "/usr/share/fonts/ttf/decoratives"
692 FontPath "/usr/share/fonts/truetype/ttf-bitstream-vera"
693 FontPath "/usr/share/fonts/latex-ttf-fonts"
694 FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
697 # Modules - see /usr/X11R6/lib/modules/fonts and /usr/X11R6/lib/modules/extensions
699 Load "dbe" # double buffer extension
700 Load "dri" # direct rendering
701 Load "glx" # 3D layer / GLX extension
702 Load "type1" # type1 font module
703 Load "freetype" # freetype fonts rendering
704 Load "extmod" # some commonly used server extensions (e.g. shape extension)
705 Load "record" # recording extension
706 Load "evdev" # generic input handling driver on Linux
707 # Load "vbe" # Vesa BIOS Extension
708 # Load "i2c" # I2C bus
709 # Load "int10" # initialize graphics cards via int10 call to the BIOS
710 # Load "v4l" # Video for Linux
711 ## Deprecated/unneeded modules with Xorg >=7.0:
712 # Load "speedo" # font module (does not exist anymore)
713 # Load "ddc" # ddc probing of monitor (automatically loaded)
714 # Load "GLcore" # render OpenGL in software (automatically loaded)
715 # Load "bitmap" # bitmap fonts (automatically loaded)
716 # Valid entries - see /usr/lib/xorg/modules/[extensions/]
717 # afb bitmap cfb cfb16 cfb24 cfb32 cw damage dbe ddc dri drm extmod fb
718 # fbdevhw freetype GLcore glx i2c int10 int10 layer mfb pcidata rac ramdac
719 # record scanpci shadow shadowfb type1 vbe vgahw xaa xf1bpp xf24_32bpp xf4bpp
720 # xf8_16bpp xf8_32bpp xtrap
723 # If you'd like to switch the positions of your capslock and control keys, use:
724 # Option "XkbOptions" "ctrl:swapcaps"
725 # Or if you just want both to be control, use:
726 # Option "XkbOptions" "ctrl:nocaps"
727 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/XKB-Config.html
728 # Section "InputDevice"
729 # Identifier "Keyboard0"
730 # Option "CoreKeyboard"
732 # # Option "XkbOptions" "ctrl:swapcaps,grp:alt_shift_toggle,grp_led:scroll,compose:menu"
735 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/mouse.html
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