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 ################################################################################
9 # make sure /tmp is writeable {{{
10 if ! [ -w /tmp ] ; then
11 echo 'Fatal: /tmp is not writeable. Can not resume therefore, sorry.' >&2
17 # usage: DEBUG=1 grml-x ..... 2>/tmp/grml-x-debug.log
18 if [[ $DEBUG -gt 0 ]]; then
23 # functions and color {{{
24 # use colors only if not booted with nocolor bootoption
25 if ! grep -q nocolor /proc/cmdline ; then
26 autoload colors ; colors
27 [ -r /etc/grml_colors ] && . /etc/grml_colors
30 # some functions like getBootParam
31 if [ -r /etc/grml/script-functions -a -r /etc/grml/sh-lib ] ; then
32 source /etc/grml/script-functions
33 source /etc/grml/sh-lib
35 echo 'Error: sourcing function files failed. Exiting.'
39 check4root &>/dev/null && ROOT='1' || ROOT=''
44 HWINFO='/usr/sbin/hwinfo'
46 [ -n "$XINITRC" ] || XINITRC="$HOME/.xinitrc"
49 HWINFO_TMP="/tmp/hwinfo.$$"
50 MONITORINFO="/tmp/monitorinfo.$$"
51 MOUSEINFO="/tmp/mouse.$$"
53 if [ -r /etc/sysconfig/keyboard ] ; then
54 source /etc/sysconfig/keyboard
60 XCONFIG='/etc/X11/xorg.conf'
61 KEYBOARD="# Driver \"kbd\"
62 # Option \"XkbRules\" \"xfree86\"
63 # Option \"XkbRules\" \"xorg\"
64 # Option \"XkbModel\" \"pc105\"
65 # Option \"XkbLayout\" \"${XKEYBOARD},us\"
66 # Option \"XkbVariant\" \"nodeadkeys\""
69 if [ -d /usr/share/fonts/X11 ] ; then
70 XFONTS=" FontPath \"/usr/share/fonts/X11/misc\"
71 FontPath \"/usr/share/fonts/X11/100dpi/:unscaled\"
72 FontPath \"/usr/share/fonts/X11/75dpi/:unscaled\"
73 FontPath \"/usr/share/fonts/X11/Type1\"
74 FontPath \"/usr/share/fonts/X11/100dpi\"
75 FontPath \"/usr/share/fonts/X11/75dpi\""
77 # /usr/X11R6/lib/X11/fonts exists nearly everywhere, assume
78 # /usr/X11R6/lib/X11/fonts as valid font path only if fonts.dir
80 if [ -r /usr/X11R6/lib/X11/fonts/misc/fonts.dir ] ; then
82 FontPath \"/usr/X11R6/lib/X11/fonts/Type1\"
83 FontPath \"/usr/X11R6/lib/X11/fonts/misc:unscaled\"
84 FontPath \"/usr/X11R6/lib/X11/fonts/misc\"
85 FontPath \"/usr/X11R6/lib/X11/fonts/75dpi:unscaled\"
86 FontPath \"/usr/X11R6/lib/X11/fonts/75dpi\"
87 FontPath \"/usr/X11R6/lib/X11/fonts/100dpi:unscaled\"
88 FontPath \"/usr/X11R6/lib/X11/fonts/100dpi\""
92 # make sure we don't leave any temp files {{{
94 rm -f "$HWINFO_TMP" "$MONITORINFO" "$MOUSEINFO"
95 [ -n "$1" ] && EXIT="$1" || EXIT="1"
96 print "$bg[black]$fg[red]${bold_color}Exiting...${reset_color}">&2
100 trap bailout 1 2 3 15
103 # warn if running as user root {{{
104 if [ -n "$ROOT" ] ; then
105 if [ -r /etc/grml_cd ] ; then
106 print "$bg[black]$fg[red]${bold_color}Warning: Please do not run grml-x as user root.${reset_color}"
107 print "$bg[black]$fg[red]${bold_color}Running grml-x as user root is *not* supported!${reset_color}"
108 print "$bg[black]$fg[red]${bold_color}Switch to user grml or run su - grml -c 'grml-x ...' instead.${reset_color}"
111 print "$bg[black]$fg[red]${bold_color}Warning: Please do not run X.org as user root!${reset_color}"
112 print "$bg[black]$fg[red]${bold_color}As soon as you have a working $XCONFIG please use startx instead of grml-x.${reset_color}"
116 fstabuser=$(grep ':x:1000:' /etc/passwd)
117 fstabuser=${fstabuser%%[:]*}
120 # usage information {{{
123 if [[ $1 != '' ]] ; then echo 1>&2 "\n$1" ; fi
124 print "$bg[black]$fg[red]$bold_color"
127 $PROGRAMNAME [-options] windowmanager
133 $PROGRAMNAME -force -nostart fluxbox
134 $PROGRAMNAME -nosynaptics fluxbox
135 $PROGRAMNAME -nosync fluxbox
136 $PROGRAMNAME -noddc wmii
137 $PROGRAMNAME -xinerama -composite wmii
138 $PROGRAMNAME -module radeon -mode 1024x768 -vsync 60 openbox
139 XINITRC=~/.xinitrc $PROGRAMNAME openbox
140 $PROGRAMNAME -display 8 openbox
142 More information on grml-x can be found in the manual page: man grml-x
144 Report bugs, send wishes and feedback to the grml team:
145 http://grml.org/bugs/ - contact (at) grml.org
147 print "${reset_color}"
155 if [ -n "$ROOT" ] ; then
156 su - $fstabuser -c "$HWINFO > $HWINFO_TMP"
158 $HWINFO > $HWINFO_TMP
166 sudo $HWINFO --monitor > $MONITORINFO
173 [ -r "$MONITORINFO" ] || monitor # get monitor settings
174 modes=$(perl -e 'while (<STDIN>) {if (/ Resolution:/) { s/.*\s+(\d+x\d+).*/$1/; print} }' < $MONITORINFO |
175 sort -nur | perl -ne 's/\s+/ /; s/(\d+x\d+)/"$1"/; print')
177 if [ -n "$XINERAMA" ] ; then
181 Option for $fg[yellow]Xinerama$fg[green] found, please use xrandr inside X.org for your further configuration!
182 Trying to identify monitors now..."
184 # make sure we have information from 2 monitors:
185 # - first one from 'hwinfo --monitor' => $MONITORINFO
186 # - second one from 'hwinfo --framebuffer' => $FRAMEBUFFER
187 FRAMEBUFFER=$(hwinfo --framebuffer | grep 'Mode 0x.* bits' | head -1)
188 if [ -z "$FRAMEBUFFER" ] ; then
190 Fatal: could not identify two monitors - no chance to
191 set up multihead using Xinerama - sorry. :-(
193 Please run grml-x without the -xinerama option to start
194 X anyway (dropping support for Xinerama of course) and
195 contact grml developers if you have any further useful
196 information. => http://grml.org/bugs/
201 # check whether we can read the $MONITORINFO file
202 if ! [ -r "$MONITORINFO" ] ; then
204 Fatal: could not identify monitor - no chance to
205 set up multihead using Xinerama - sorry. :-(
209 # Currently we only know that it works with current intel driver,
210 # so inform user about that:
211 if [[ "$MODULE" != "intel" ]] ; then
214 Warning: using a non-intel driver - trying Xinerama setup anyway.
215 If it worked please contact grml developers providing information
216 about your setup so we can adjust grml-x according!
218 -> http://grml.org/contact/
220 Sleeping for 10 seconds now... Will continue then...
221 Just press Ctrl-C to cancel operation.
226 # now calculate Virtual size for use with Xinerama
227 HORIZ_RES1="$(grep 'Max. Resolution:' $MONITORINFO | sed 's/ Max\. Resolution: \(.*\)x\(.*\)/\1/')"
228 VERIZ_RES1="$(grep 'Max. Resolution:' $MONITORINFO | sed 's/ Max\. Resolution: \(.*\)x\(.*\)/\2/')"
229 # it might happen that we don't have a Max Resolution in hwinfo output :-/
230 # fall back to a generic value then...
231 # TODO: check out how to get resolution of external monitor from console
232 if [ -z "$HORIZ_RES1" ] ; then
237 # get maximum of output
238 HORIZ_RES2="$(echo $FRAMEBUFFER | grep 'Mode 0x' | sed 's/ Mode 0x.*: \(.*\)x.*/\1/'| sort -u | head -1)"
239 VERIZ_RES2="$(echo $FRAMEBUFFER | grep 'Mode 0x' | sed 's/ Mode 0x.*x\(.*\) (.*/\1/' | sort -u | head -1)"
241 if [ -n "$HORIZ_RES1" -a -n "$VERIZ_RES1" -a -n "$HORIZ_RES2" -a -n "$VERIZ_RES2" ] ; then
242 if [ "$(echo $VERIZ_RES1" - "$VERIZ_RES2 | bc -l)" -eq 0 ] ; then
243 VERIZ_RESULT="$VERIZ_RES1"
244 elif [ "$VERIZ_RES1" -gt "$VERIZ_RES2" ] ; then
245 VERIZ_RESULT="$VERIZ_RES1"
247 VERIZ_RESULT="$VERIZ_RES2"
250 HORIZ_RESULT=$(echo $HORIZ_RES1 + $HORIZ_RES2 | bc -l)
252 # important: keep newline for appropriate placing below $MODES!
253 if [ -n "$HORIZ_RESULT" ] ; then
255 Virtual $HORIZ_RESULT $VERIZ_RES1"
261 if [[ -n $NODDC ]] ; then
262 MODES="Modes \"1024x768\" \"800x600\" \"640x480\" \"1600x1200\" \"1280x1024\" \"1280x960\"$VIRTUAL"
263 elif [[ "$modes" == "\"1024x768\" " || -z $modes ]] ; then
264 MODES="# Modes \"1024x768\" \"800x600\" \"640x480\" \"1600x1200\" \"1280x1024\" \"1280x960\"$VIRTUAL"
266 MODES="# Modes $modes$VIRTUAL"
271 # sync - get hsync/vsync settings {{{
274 [ -r "$MONITORINFO" ] || monitor # get monitor settings
275 [ -r "$MONITORINFO" ] || bailout 1
276 vsyncval=$(awk '/Vert. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
277 hsyncval=$(awk '/Hor. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
278 if [ -z $vsyncval ] ; then
279 vsyncval='50.0 - 60.0'
281 if [ -z $hsyncval ] ; then
282 hsyncval='28.0 - 96.0'
290 sudo $HWINFO --mouse > $MOUSEINFO
292 # SynPS/2 Synaptics TouchPad
293 if grep -q 'Device:.*Synaptics' "$MOUSEINFO" ; then
294 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
295 MOUSEDRIVER='synaptics'
296 SYNMOUSE='InputDevice "Synaptics" # "AlwaysCore"'
298 Section \"InputDevice\"
300 Identifier \"Synaptics\"
301 Option \"Device\" \"/dev/psaux\"
302 Option \"Protocol\" \"auto-dev\"
303 Option \"LeftEdge\" \"1700\"
304 Option \"RightEdge\" \"5300\"
305 Option \"TopEdge\" \"1700\"
306 Option \"BottomEdge\" \"4200\"
307 Option \"FingerLow\" \"25\"
308 Option \"FingerHigh\" \"30\"
309 Option \"ZAxisMapping\" \"4 5\"
310 Option \"MaxTapTime\" \"180\"
311 Option \"MaxTapMove\" \"220\"
312 Option \"VertScrollDelta\" \"100\"
313 Option \"MinSpeed\" \"0.06\"
314 Option \"MaxSpeed\" \"0.12\"
315 Option \"AccelFactor\" \"0.0010\"
316 # Option \"SHMConfig\" \"on\"
317 # Option \"Repeater\" \"/dev/ps2mouse\"
323 SYNMOUSE='# No synaptics touchpad detected.'
327 # AlpsPS/2 ALPS TouchPad (with Synapticsdriver)
328 if grep -q 'Device:.*ALPS' "$MOUSEINFO" ; then
329 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
330 MOUSEDRIVER='synaptics'
331 SYNMOUSE='InputDevice "Synaptics" # "AlwaysCore"'
333 Section \"InputDevice\"
335 Identifier \"Synaptics\"
336 Option \"Device\" \"/dev/psaux\"
337 Option \"Protocol\" \"auto-dev\"
338 Option \"LeftEdge\" \"120\"
339 Option \"RightEdge\" \"850\"
340 Option \"TopEdge\" \"120\"
341 Option \"BottomEdge\" \"650\"
342 Option \"FingerLow\" \"14\"
343 Option \"FingerHigh\" \"15\"
344 Option \"ZAxisMapping\" \"4 5\"
345 Option \"MaxTapTime\" \"180\"
346 Option \"MaxTapMove\" \"50\"
347 Option \"MaxDoubleTapTime\" \"100\"
348 Option \"VertScrollDelta\" \"20\"
349 Option \"HorizScrollDelta\" \"20\"
350 Option \"MinSpeed\" \"0.3\"
351 Option \"MaxSpeed\" \"2.00\"
352 Option \"AccelFactor\" \"0.030\"
353 Option \"UpDownScrolling\" \"1\"
354 Option \"EmulateMiddleButtonTime\" \"75\"
355 Option \"CircularScrolling\" \"1\"
356 Option \"CircScrollDelta\" \"0.1\"
357 Option \"CircScrollTrigger\" \"8\"
358 # Option \"SHMConfig\" \"on\"
359 # Option \"Repeater\" \"/dev/ps2mouse\"
365 SYNMOUSE='# No alps touchpad detected.'
368 SYNMOUSE='# No synaptics/alps touchpad present.'
372 # USB-PS/2 Optical Mouse
373 if [ -n "$USE_USB" ] ; then
374 USBMOUSE='InputDevice "USB Mouse" "CorePointer"'
376 Section \"InputDevice\"
377 Identifier \"USB Mouse\"
379 Option \"Device\" \"/dev/input/mice\"
380 Option \"Protocol\" \"auto\"
381 Option \"ZAxisMapping\" \"4 5\"
382 Option \"Buttons\" \"5\"
383 Option \"SendCoreEvents\" \"true\"
387 USBMOUSE='# InputDevice "USB Mouse" "CorePointer"'
391 if grep -q 'Device:.*Serial' "$MOUSEINFO" ; then
393 SERMOUSE='InputDevice "Serial Mouse" "CorePointer"'
395 Section \"InputDevice\"
396 Identifier \"Serial Mouse\"
398 Option \"Device\" \"/dev/ttyS0\"
399 Option \"Protocol\" \"Microsoft\"
400 Option \"Emulate3Buttons\" \"true\"
401 Option \"Emulate3Timeout\" \"70\"
402 Option \"SendCoreEvents\" \"true\"
406 SERMOUSE='# No serial mouse detected.'
410 # ImExPS/2 Logitech Explorer Mouse
411 # "PS2++ Logitech MX Mouse"
412 if [ -n "$USE_PS2" ] ; then
414 PS2MOUSE='InputDevice "PS/2 Mouse" "CorePointer"'
416 Section \"InputDevice\"
417 Identifier \"PS/2 Mouse\"
419 Option \"Device\" \"/dev/input/mice\"
420 # Option \"Device\" \"/dev/psaux\"
421 Option \"Protocol\" \"PS/2\"
422 Option \"Emulate3Buttons\" \"true\"
423 Option \"Emulate3Timeout\" \"70\"
424 Option \"SendCoreEvents\" \"true\"
428 PS2MOUSE='# InputDevice "PS/2 Mouse" "CorePointer"'
433 # Section \"InputDevice\"
434 # Identifier \"Generic Mouse\"
436 # Option \"Device\" \"/dev/input/mice\"
437 # Option \"Protocol\" \"auto\"
438 # Option \"ZAxisMapping\" \"4 5\"
439 # Option \"Buttons\" \"5\"
440 # Option \"SendCoreEvents\" \"true\"
451 # commandline parsing {{{
454 zparseopts -K -- module:=o_module help=o_help noddc=o_noddc nosync=o_nosync \
455 vsync:=o_vsync hsync:=o_hsync mode:=o_mode force=o_force display:=o_display \
456 nostart=o_nostart nodpms=o_nodpms nosynaptics=o_nosynaptics nousb=o_nousb \
457 nops2=o_nops2 genmouse=o_genmouse novref=o_novref nohsync=o_nohsync \
458 fallback=o_fallback usb=o_usb ps2=o_ps2 composite=o_composite \
461 if [[ $# == 0 || "$o_help" != "" || "$1" == '-h' || "$1" == '--help' ]]; then
465 if [[ "$o_force" != "" ]]; then
469 if [[ "$o_fallback" != "" ]]; then
471 if [ -r /etc/X11/xorg.conf.example ] ; then
472 sudo cp /etc/X11/xorg.conf.example $XCONFIG
473 print "$bold_color$fg[blue]Copying /etc/X11/xorg.conf.example to $XCONFIG as requested via fallback option."
475 echo 'Error: /etc/X11/xorg.conf.example not readable, exiting.'
480 if [[ "$o_nodpms" != "" ]]; then
481 DPMS='Option "DPMS" "false"'
483 DPMS='Option "DPMS" "true"'
486 if [[ "$o_noddc" != "" ]]; then
490 if [[ "$o_vsync" != "" ]]; then
494 if [[ "$o_hsync" != "" ]]; then
498 if [[ "$o_nousb" != "" ]]; then
499 echo 'Warning: option -nousb is deprecated.'>&2
502 if [[ "$o_usb" != "" ]]; then
506 if [[ "$o_nops2" != "" ]]; then
507 echo 'Warning: optino -nops2 is deprecatedË™'>&2
510 if [[ "$o_ps2" != "" ]]; then
514 if [[ "$o_genmouse" != "" ]]; then
518 if [[ "$o_nosynaptics" != "" ]]; then
524 if [[ "$o_nostart" != "" ]]; then
528 DISPLAY=$o_display[2]
530 eval WINDOWMANAGER=\${$#}
532 if [[ "$XKEYBOARD" == de ]] ; then
534 # Option \"XkbVariant\" \"nodeadkeys\""
537 if [ -n "$FORCE" -o ! -r "$XCONFIG" -a -z "$FALLBACK" ] ; then
538 print -n "$bold_color$fg[blue]Gathering hardware information...$fg[red]"
540 sync # get hsync/vsync
542 if [ -z "$o_hsync" ] ; then
543 o_hsync=(-hsync "$hsyncval")
545 HORIZSYNC=" HorizSync $HSYNC"
547 o_hsync=(-hsync "$o_hsync[2]")
549 HORIZSYNC=" HorizSync $HSYNC"
552 if [ -z "$o_vsync" ] ; then
553 o_vsync=(-vsync "$vsyncval")
555 VERTISYNC=" VertRefresh $VSYNC"
557 o_vsync=(-vsync "$o_vsync[2]")
559 VERTISYNC=" VertRefresh $VSYNC"
562 if [[ "$o_nosync" != "" ]]; then
563 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nosync option of grml-x"
564 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -nosync option of grml-x"
567 if [[ "$o_nohsync" != "" ]]; then
568 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nohsync option of grml-x"
571 if [[ "$o_novref" != "" ]]; then
572 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -novref option of grml-x"
575 if [[ "$o_xinerama" != "" ]]; then
579 if [[ "$o_composite" != "" ]]; then
580 COMPOSITE="Section \"Extensions\"
581 Option \"Composite\" \"Enable\"
584 COMPOSITE="#Section \"Extensions\"
585 # Option \"Composite\" \"Enable\"
593 [ -r "$HWINFO_TMP" ] || bailout 1
594 MONITOR=$(awk '/monitor.1:/{print $3}' $HWINFO_TMP)
595 [[ $MONITOR != 'ddc' ]] && NODDC=yes
599 if [ -z "$MODULE" ] ; then
600 MODULE="$(getBootParam xmodule 2>/dev/null)"
601 if [ -z "$MODULE" ] ; then
602 MODULE=$(grep 'XFree86 v4 Server Module:' "${HWINFO_TMP}" | head -1 | awk '{print $5}')
603 if [ -z "$MODULE" ] ; then
606 # hwinfo >=13.28 reports driver 'intel' instead of i810
607 if [[ "$MODULE" == 'intel' ]] ; then
608 [ -r /usr/lib/xorg/modules/drivers/intel_drv.so ] || MODULE='i810'
615 mouse # get mouse settings
616 VGA=$(lspci | grep VGA | sed 's/.*compatible controller: //' | head -1)
619 if [ -z $MODE ] ; then
620 B_MODE="$(getBootParam xmode 2>/dev/null)"
621 if [ -n "$B_MODE" ] ; then
622 MODES="Modes \"$B_MODE\""
625 if [ -z "$MODES" ] ; then
626 mode # get available modes
629 MODES="Modes \"$MODE\""
633 print "$fg[green]done$reset_color"
634 print "$bg[black]$fg[white]$bold_color"
635 print "$fg[green]Specified windowmanager is $fg[yellow]$WINDOWMANAGER"
636 print "$fg[green]Video is $fg[yellow]$VGA$fg[green] using $bg[black]$fg[yellow]${XSERVER}$fg[cyan](${MODULE})$fg[green] Server"
637 [[ -z $HSYNC ]] && [[ -z $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR"
638 [[ -z $HSYNC ]] && [[ -n $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], VSYNC: $fg[yellow]$VSYNC"
639 [[ -z $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC"
640 [[ -n $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC $fg[green]VSYNC: $fg[yellow]$VSYNC"
641 [[ -n $modes ]] && print "$fg[green]Using default X.org modes."
642 [[ -z $modes ]] && print "$fg[green]Using Mode: $fg[yellow]$MODE"
643 print "${reset_color}"
649 # check for requirements {{{
652 if ! [ -x $(which hwinfo) ] ; then
653 print "$bg[black]$fg[red]${bold_color}Error: hwinfo not found in path.${reset_color}
654 Note: run 'aptitude install hwinfo' on systems running debian.
655 Exiting.${reset_color}"
659 if ! [[ -d /sys ]] ; then
660 print "$bg[black]$fg[red]${bold_color}Error: mounted /sys required (for hwinfo).${reset_color}
661 You may want to add the following line to your /etc/fstab:
663 sysfs /sys sysfs defaults 0 0
665 or just run 'mount /sys'. Exiting.${reset_color}"
675 ################################################################################
677 # Purpose: config file for xserver - generated by grml-x
678 # Bug-Reports: see http://grml.org/bugs/
679 # Latest change: ${DATE}
681 # /usr/share/doc/xserver-xorg/ and
682 # http://wiki.x.org/wiki/Home and
683 # http://ftp.x.org/pub/X11R7.0/doc/html/index.html for information on Xorg
685 # Refer to the xorg.conf man page and to
686 # http://ftp.x.org/pub/X11R7.0/doc/html/xorg.conf.5.html
687 # for details about the format of this file.
689 # See http://wiki.debian.org/XStrikeForce/FAQ for information
690 # regarding Xorg packages within Debian.
692 # If you would like this file to be automatically reconfigured by debian,
693 # run the following command:
694 # sudo dpkg-reconfigure -phigh xserver-xorg
695 ################################################################################
697 Section "ServerLayout"
698 Identifier "XServer Configured"
699 Screen 0 "Screen0" 0 0
700 # InputDevice "Keyboard0" "CoreKeyboard"
701 # InputDevice "Generic Mouse" "CorePointer"
705 Section "ServerFlags"
706 Option "AllowMouseOpenFail" "true" # allows the server to start up even if the mouse does not work
707 Option "DontVTSwitch" "false" # allow switching between virtual terminal
708 # Option "DontZap" "true" # disable <Crtl><Alt><BS> (server abort)
709 # Option "DontZoom" "true" # disable <Crtl><Alt><KP_+>/<KP_-> (resolution switching)
713 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/fonts.html
715 # FontPath "/usr/share/fonts/ttf/western"
716 # FontPath "/usr/share/fonts/ttf/decoratives"
717 FontPath "/usr/share/fonts/truetype/ttf-bitstream-vera"
718 FontPath "/usr/share/fonts/latex-ttf-fonts"
719 FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
722 # Modules - see /usr/lib/xorg/modules/fonts and /usr/lib/xorg/modules/extensions
724 Load "dbe" # double buffer extension
725 Load "dri" # direct rendering
726 Load "glx" # 3D layer / GLX extension
727 Load "type1" # type1 font module
728 Load "freetype" # freetype fonts rendering
729 Load "extmod" # some commonly used server extensions (e.g. shape extension)
730 Load "record" # recording extension
731 Load "evdev" # generic input handling driver on Linux
732 Load "xtrap" # X Trap extension
733 # Load "vbe" # Vesa BIOS Extension
734 # Load "i2c" # I2C bus
735 # Load "int10" # initialize graphics cards via int10 call to the BIOS
736 # Load "v4l" # Video for Linux
737 ## Deprecated/unneeded modules with Xorg >=7.0:
738 # Load "speedo" # font module (does not exist anymore)
739 # Load "ddc" # ddc probing of monitor (automatically loaded)
740 # Load "GLcore" # render OpenGL in software (automatically loaded)
741 # Load "bitmap" # bitmap fonts (automatically loaded)
742 # Valid entries - see /usr/lib/xorg/modules/[extensions/]
743 # afb bitmap cfb cfb16 cfb24 cfb32 cw damage dbe ddc dri drm extmod fb
744 # fbdevhw freetype GLcore glx i2c int10 int10 layer mfb pcidata rac ramdac
745 # record scanpci shadow shadowfb type1 vbe vgahw xaa xf1bpp xf24_32bpp xf4bpp
746 # xf8_16bpp xf8_32bpp xtrap
749 # If you'd like to switch the positions of your capslock and control keys, use:
750 # Option "XkbOptions" "ctrl:swapcaps"
751 # Or if you just want both to be control, use:
752 # Option "XkbOptions" "ctrl:nocaps"
753 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/XKB-Config.html
754 # Section "InputDevice"
755 # Identifier "Keyboard0"
756 # Option "CoreKeyboard"
758 # # Option "XkbOptions" "ctrl:swapcaps,grp:alt_shift_toggle,grp_led:scroll,compose:menu"
761 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/mouse.html
762 ${USBMOUSEDETAIL}${PS2MOUSEDETAIL}${SERMOUSEDETAIL}${SYNMOUSEDETAIL}${EVDEV_MOUSE}
764 Identifier "Monitor0"
765 # ModelName "Old Monitor (no DDC)"
767 # HorizSync 28.0 - 78.0 # Warning: This may fry very old Monitors
768 # HorizSync 28.0 - 96.0 # Warning: This may fry old Monitors
770 # VertRefresh 50.0 - 76.0 # Very conservative. May flicker.
771 # VertRefresh 50.0 - 60.0 # Extreme conservative. Will flicker. TFT default.
773 # Need more information?
774 # http://xtiming.sourceforge.net/cgi-bin/xtiming.pl
775 # http://en.tldp.org/HOWTO/XFree86-Video-Timings-HOWTO/
779 ### Available Driver options are:
780 ## sw_cursor is needed for some ati and radeon cards
789 # Option "RenderAccel" "true"
790 # Option "AllowGLXWithComposite" "true"
792 # The following line is auto-generated by grml-x
796 ## Workaround for drivers (for example radeon) which might send output to wrong device:
797 # Option "MonitorLayout" "LVDS, AUTO"
798 # Option "MonitorLayout" "LVDS, CRT"
799 # Option "MonitorLayout" "NONE, STV"
800 # Option "MonitorLayout" "LVDS"
840 # Make sure you have the relevant Debian packages on your system
841 # to be able to use DRI (libgl1-mesa-dri for example)
848 ## END OF FILE #################################################################
855 XCONFTMP="/tmp/xconfig.$$"
857 # we do not want to have two CorePointers, deactivate one therefore
858 if grep -Eq '^[[:space:]]+InputDevice[ ]+"USB Mouse"[ ]+"CorePointer"' $XCONFTMP ; then
859 if grep -Eq '^[[:space:]]+InputDevice[ ]+"PS/2 Mouse"[ ]+"CorePointer"' $XCONFTMP ; then
860 sed -i 's|InputDevice.*PS/2.*CorePointer|# & # deactivated to avoid two CorePointers|' $XCONFTMP
863 [ -f $XCONFIG ] && sudo mv -f $XCONFIG $XCONFIG.old
864 sudo mv $XCONFTMP $XCONFIG
865 sudo chown root.root $XCONFIG
866 sudo chmod 644 $XCONFIG
873 if [[ ! -f $XCONFIG ]] ; then
874 print -n "$bold_color$fg[blue]Creating $XCONFIG: $fg[red]"
875 writeit && print "$fg[green]done$reset_color"
877 if [ -z "$FORCE" -a -z "$FALLBACK" ] ; then
878 print "$bold_color$fg[blue]Notice: $XCONFIG exists already.
879 Use the force-option (-force) to force creation.
883 if [[ -n "$FORCE" ]] ; then
884 print "$bold_color$fg[blue]Force-switch or manual option(s) detected:"
885 print -n "\-> Moving eventual existing $XCONFIG to ${XCONFIG}.old: $fg[red]"
886 writeit && print "$fg[green]done$reset_color"
895 if [ "$(readlink /etc/X11/X)" = /bin/true ] ; then
896 print "$bold_color$fg[red]Fatal: /etc/X11/X is a symlink to /bin/true."
897 print "Fix it via running 'ln -sf /usr/bin/Xorg /etc/X11/X'"
900 if [ -z "$NOSTART" ] ; then
902 if [ -x /etc/init.d/xorg-common ] ; then
903 sudo /etc/init.d/xorg-common start
905 if [ -x /etc/init.d/xfree86-common ] ; then
906 sudo /etc/init.d/xfree86-common start
910 if [ -z "$DISPLAY" ] ; then
911 print "$bold_color$fg[green]Now trying to run startx.$reset_color"
912 startx $XINITRC -- $XOPTS
915 print "$bold_color$fg[green]Now trying to run startx on display $DISPLAY.$reset_color"
916 startx $XINITRC -- :$DISPLAY $XOPTS
920 print "$bold_color$fg[blue]Not running startx as requested via option.$reset_color"
929 if [ -z "$ROOT" ] ; then
930 if [[ $(tty) == /dev/pts/* ]] ; then
931 print "It seems you are running $PROGRAMNAME from inside GNU screen.
932 Notice that this might fail if running as user grml!
933 Please exit screen and try to run $PROGRAMNAME again."
936 print "Run the following commands for getting information on your hardware:
938 discover -v --data-path=xfree86/server/device/driver display
939 xdebconfigurator -c -d -i -x
940 get-edid | parse-edid
942 Do you want to go the debian way of life? Run:
943 aptitude install xorg read-edid mdetect hwinfo xdebconfigurator
944 dpkg-reconfigure -phigh xserver-xorg
946 Problems with the module used for X? Try to load another one or
947 fall back to module vesa:
948 $PROGRAMNAME -module radeon ...
949 $PROGRAMNAME -module vesa ...
951 Do you want to deactivate a present synaptics touchpad? Run:
952 $PROGRAMNAME -nosynaptics ...
954 Your monitor is very old and/or does not support DDC-probing?
955 $PROGRAMNAME -noddc ...
957 Do you want to create a x configuration file but do not start X?
958 $PROGRAMNAME -nostart ...
960 Monitor frequency too high or too low? Just specify hsync/vsync manually:
961 $PROGRAMNAME -hsync 30-65 ...
962 $PROGRAMNAME -hsync 30-65 -vsync 50-60 ...
964 Want to adjust the resolution? Use the mode-switch:
965 $PROGRAMNAME -mode 1024x768 ...
966 $PROGRAMNAME -mode '1280x1024 1024x768' ...
968 Problems? Use vesa with resolution 1024x768:
969 $PROGRAMNAME -module vesa -mode 1024x768 ...
971 Still problems with X? Use the fallback option:
972 $PROGRAMNAME -fallback ...
974 To adjust resolution while running X execute:
977 More information on grml-x can be found in the manual page: man grml-x
979 Report bugs, send wishes and feedback to the grml team:
980 http://grml.org/bugs/ - contact (at) grml.org
982 print -n "$reset_color"
998 if ! [ -x "$(which $WINDOWMANAGER)" ] ; then
999 print "$bg[black]$fg[red]${bold_color}Fatal: windowmanager $fg[blue]$WINDOWMANAGER$fg[red] not executable, startx will not work.${reset_color}">&2
1002 if [ -w "$XINITRC" ] ; then
1003 sed -i "s|^[^#]*exec.*| exec $WINDOWMANAGER|g" $XINITRC
1006 echo -e "#!/bin/sh\n exec $WINDOWMANAGER" >> $XINITRC
1011 ## END OF FILE #################################################################
1012 # vim:foldmethod=marker expandtab ai ft=zsh