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: Sam Jän 20 10:42:37 CET 2007 [mika]
8 ################################################################################
11 if [[ $DEBUG -gt 0 ]]; then
14 autoload colors ; colors
15 [ -r /etc/grml_colors ] && . /etc/grml_colors
16 [ -r /etc/grml/sh-lib ] && . /etc/grml/sh-lib
17 if [ -r /etc/sysconfig/keyboard ] ; then
18 source /etc/sysconfig/keyboard
24 # warn if running as user root {{{
25 if [[ $UID == 0 ]] ; then
26 print "$bg[black]$fg[red]${bold_color}Warning: Please do not run grml-x as user root.${reset_color}"
27 print "$bg[black]$fg[red]${bold_color}Running grml-x as user root is *not* supported!${reset_color}"
28 print "$bg[black]$fg[red]${bold_color}Switch to user grml or run su - grml -c 'grml-x ...' instead.${reset_color}"
31 fstabuser=$(grep ':x:1000:' /etc/passwd)
32 export fstabuser=${fstabuser%%[:]*}
37 HWINFO='/usr/sbin/hwinfo'
39 (( ${+XINITRC} )) || XINITRC="$HOME/.xinitrc"
42 # usage information {{{
45 if [[ $1 != '' ]] ; then echo 1>&2 "\n$1" ; fi
46 print "$bg[black]$fg[red]$bold_color"
49 $PROGRAMNAME [-options] windowmanager
55 $PROGRAMNAME -force -nostart fluxbox
56 $PROGRAMNAME -nosynaptics fluxbox
57 $PROGRAMNAME -nosync fluxbox
58 $PROGRAMNAME -noddc wmii
59 $PROGRAMNAME -nousb fluxbox
60 $PROGRAMNAME -module radeon -mode 1024x768 -vsync 60 wmi
61 XINITRC=~/.xinitrc $PROGRAMNAME ion
62 $PROGRAMNAME -display 8 wmii
64 More information on grml-x can be found in the manual page: man grml-x
66 Report bugs, send wishes and feedback to the grml team:
67 http://grml.org/bugs/ - contact (at) grml.org
69 # $PROGRAMNAME wmi -- :8
70 print "${reset_color}"
78 HWINFO_TMP="/tmp/hwinfo.$$"
79 if [[ $UID == 0 ]] ; then
80 su - $fstabuser -c "$HWINFO > $HWINFO_TMP"
90 MONITORINFO="/tmp/monitorinfo.$$"
91 sudo $HWINFO --monitor > $MONITORINFO
98 modes=$(perl -e 'while (<STDIN>) {if (/ Resolution:/) { s/.*\s+(\d+x\d+).*/$1/; print} }' < $MONITORINFO |
99 sort -nur | perl -ne 's/\s+/ /; s/(\d+x\d+)/"$1"/; print')
100 if [[ -n $NODDC ]] ; then
101 MODES='Modes "1024x768" "800x600" "640x480" "1600x1200" "1280x1024" "1280x960"'
102 elif [[ "$modes" == "\"1024x768\" " || -z $modes ]] ; then
103 MODES='# Modes "1024x768" "800x600" "640x480" "1600x1200" "1280x1024" "1280x960"'
105 MODES="# Modes $modes"
110 # sync - get hsync/vsync settings {{{
113 monitor # get monitor settings
114 vsyncval=$(awk '/Vert. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
115 hsyncval=$(awk '/Hor. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
116 if [ -z $vsyncval ] ; then
117 vsyncval='50.0 - 60.0'
119 if [ -z $hsyncval ] ; then
120 hsyncval='28.0 - 96.0'
129 MOUSEINFO="/tmp/mouse.$$"
130 # if [[ $UID == 0 ]] ; then
131 # su - $fstabuser -c "$HWINFO --mouse > $MOUSEINFO"
133 sudo $HWINFO --mouse > $MOUSEINFO
136 # SynPS/2 Synaptics TouchPad
137 if grep -q 'Device:.*Synaptics' "$MOUSEINFO" ; then
138 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
139 MOUSEDRIVER='synaptics'
140 # SYNMOUSE='InputDevice "Synaptics" "CorePointer"'
141 SYNMOUSE='InputDevice "Synaptics" "AlwaysCore"'
143 Section \"InputDevice\"
145 Identifier \"Synaptics\"
146 Option \"Device\" \"/dev/psaux\"
147 Option \"Protocol\" \"auto-dev\"
148 Option \"LeftEdge\" \"1700\"
149 Option \"RightEdge\" \"5300\"
150 Option \"TopEdge\" \"1700\"
151 Option \"BottomEdge\" \"4200\"
152 Option \"FingerLow\" \"25\"
153 Option \"FingerHigh\" \"30\"
154 Option \"ZAxisMapping\" \"4 5\"
155 Option \"MaxTapTime\" \"180\"
156 Option \"MaxTapMove\" \"220\"
157 Option \"VertScrollDelta\" \"100\"
158 Option \"MinSpeed\" \"0.06\"
159 Option \"MaxSpeed\" \"0.12\"
160 Option \"AccelFactor\" \"0.0010\"
161 # Option \"SHMConfig\" \"on\"
162 # Option \"Repeater\" \"/dev/ps2mouse\"
168 SYNMOUSE='# No synaptics touchpad detected.'
172 # AlpsPS/2 ALPS TouchPad (with Synapticsdriver)
173 if grep -q 'Device:.*ALPS' "$MOUSEINFO" ; then
174 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
175 MOUSEDRIVER='synaptics'
176 # SYNMOUSE='InputDevice "Synaptics" "CorePointer"'
177 SYNMOUSE='InputDevice "Synaptics" "AlwaysCore"'
179 Section \"InputDevice\"
181 Identifier \"Synaptics\"
182 Option \"Device\" \"/dev/psaux\"
183 Option \"Protocol\" \"auto-dev\"
184 Option \"LeftEdge\" \"120\"
185 Option \"RightEdge\" \"850\"
186 Option \"TopEdge\" \"120\"
187 Option \"BottomEdge\" \"650\"
188 Option \"FingerLow\" \"14\"
189 Option \"FingerHigh\" \"15\"
190 Option \"ZAxisMapping\" \"4 5\"
191 Option \"MaxTapTime\" \"180\"
192 Option \"MaxTapMove\" \"50\"
193 Option \"MaxDoubleTapTime\" \"100\"
194 Option \"VertScrollDelta\" \"20\"
195 Option \"HorizScrollDelta\" \"20\"
196 Option \"MinSpeed\" \"0.3\"
197 Option \"MaxSpeed\" \"2.00\"
198 Option \"AccelFactor\" \"0.030\"
199 Option \"UpDownScrolling\" \"1\"
200 Option \"EmulateMiddleButtonTime\" \"75\"
201 Option \"CircularScrolling\" \"1\"
202 Option \"CircScrollDelta\" \"0.1\"
203 Option \"CircScrollTrigger\" \"8\"
204 # Option \"SHMConfig\" \"on\"
205 # Option \"Repeater\" \"/dev/ps2mouse\"
211 SYNMOUSE='# No alps touchpad detected.'
214 SYNMOUSE='# No alps touchpad present.'
218 # USB-PS/2 Optical Mouse
219 # if grep -q 'Device:.*USB' "$MOUSEINFO" ; then
220 if ! [[ -n $NOUSB ]] ; then
222 USBMOUSE='InputDevice "USB Mouse" "CorePointer"'
224 Section \"InputDevice\"
225 Identifier \"USB Mouse\"
227 Option \"Device\" \"/dev/input/mice\"
228 Option \"Protocol\" \"auto\"
229 Option \"ZAxisMapping\" \"4 5\"
230 Option \"Buttons\" \"5\"
231 Option \"SendCoreEvents\" \"true\"
235 USBMOUSE='# Deactivated USB Mouse as requested.'
238 if grep -q 'Device:.*Serial' "$MOUSEINFO" ; then
240 SERMOUSE='InputDevice "Serial Mouse" "CorePointer"'
242 Section \"InputDevice\"
243 Identifier \"Serial Mouse\"
245 Option \"Device\" \"/dev/ttyS0\"
246 Option \"Protocol\" \"Microsoft\"
247 Option \"Emulate3Buttons\" \"true\"
248 Option \"Emulate3Timeout\" \"70\"
249 Option \"SendCoreEvents\" \"true\"
253 SERMOUSE='# No serial mouse detected.'
256 # ImExPS/2 Logitech Explorer Mouse
257 # "PS2++ Logitech MX Mouse"
258 if ! [[ -n $NOPS2 ]] ; then
259 if grep -qE 'Device:.*PS.?2' "$MOUSEINFO" ; then
261 PS2MOUSE='InputDevice "PS/2 Mouse" "CorePointer"'
263 Section \"InputDevice\"
264 Identifier \"PS/2 Mouse\"
266 Option \"Device\" \"/dev/input/mice\"
267 # Option \"Device\" \"/dev/psaux\"
268 Option \"Protocol\" \"PS/2\"
269 Option \"Emulate3Buttons\" \"true\"
270 Option \"Emulate3Timeout\" \"70\"
271 Option \"SendCoreEvents\" \"true\"
275 PS2MOUSE='# No PS/2 mouse detected.'
279 PS2MOUSE='# Deactivated PS/2 Mouse as requested.'
282 if [[ -n $GENERICMOUSE ]] ; then
284 GENERICMOUSE='InputDevice "Generic Mouse" "CorePointer"'
286 Section \"InputDevice\"
287 Identifier \"Generic Mouse\"
289 Option \"Device\" \"/dev/input/mice\"
290 Option \"Protocol\" \"auto\"
291 Option \"Buttons\" \"5\"
292 Option \"ZAxisMapping\" \"4 5\"
296 GENERICMOUSE='# No generic mouse configured.'
307 # commandline parsing {{{
311 #o_xserver=(-xserver XFree86)
312 #o_hsync=(-hsync '28.0 - 96.0')
313 #o_vsync=(-vsync '50.0 - 60.0')
315 zparseopts -K -- xserver:=o_xserver module:=o_module help=o_help noddc=o_noddc nosync=o_nosync \
316 vsync:=o_vsync hsync:=o_hsync mode:=o_mode force=o_force display:=o_display \
317 nostart=o_nostart nodpms=o_nodpms nosynaptics=o_nosynaptics nousb=o_nousb \
318 nops2=o_nops2 genmouse=o_genmouse novref=o_novref nohsync=o_nohsync
320 if [[ $# == 0 || "$o_help" != "" || "$1" == '-h' || "$1" == '--help' ]]; then
324 if [[ "$o_force" != "" ]]; then
328 if [[ "$o_nodpms" != "" ]]; then
329 DPMS='Option "DPMS" "false"'
331 DPMS='Option "DPMS" "true"'
334 if [[ "$o_noddc" != "" ]]; then
338 if [[ "$o_vsync" != "" ]]; then
342 if [[ "$o_hsync" != "" ]]; then
346 if [[ "$o_xserver" != "" ]]; then
350 if [[ "$o_nousb" != "" ]]; then
354 if [[ "$o_nops2" != "" ]]; then
358 if [[ "$o_genmouse" != "" ]]; then
362 if [[ "$o_nosynaptics" != "" ]]; then
368 if [[ "$o_nostart" != "" ]]; then
372 DISPLAY=$o_display[2]
373 if [ -z $o_hsync ] ; then
374 o_hsync=(-hsync "$hsyncval")
376 HORIZSYNC=" HorizSync $HSYNC"
378 o_hsync=(-hsync "$o_hsync[2]")
380 HORIZSYNC=" HorizSync $HSYNC"
383 if [ -z $o_vsync ] ; then
384 o_vsync=(-vsync "$vsyncval")
386 VERTISYNC=" VertRefresh $VSYNC"
388 o_vsync=(-vsync "$o_vsync[2]")
390 VERTISYNC=" VertRefresh $VSYNC"
393 if [[ "$o_nosync" != "" ]]; then
394 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nosync option of grml-x"
395 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -nosync option of grml-x"
397 if [[ "$o_nohsync" != "" ]]; then
398 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nohsync option of grml-x"
400 if [[ "$o_novref" != "" ]]; then
401 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -novref option of grml-x"
404 eval WINDOWMANAGER=\${$#}
406 XSERVER=$o_xserver[2]
407 if [[ -n $(X -version 2>&1| grep XFree86) || "$XSERVER" == XFree86 ]] ; then
409 XCONFIG='/etc/X11/XF86Config-4'
410 KEYBOARD="Driver \"keyboard\"
411 Option \"XkbRules\" \"xfree86\"
412 Option \"XkbModel\" \"pc105\"
413 Option \"XkbLayout\" \"${XKEYBOARD},us\"
414 # Option \"XkbVariant\" \"nodeadkeys\""
415 elif [[ -n $(X -version 2>&1 | grep -e 'X\.Org' -e 'Version 7\.') || "$XSERVER" == Xorg ]] ; then
417 XCONFIG='/etc/X11/xorg.conf'
418 KEYBOARD="Driver \"kbd\"
419 # Option \"XkbRules\" \"xfree86\"
420 Option \"XkbRules\" \"xorg\"
421 Option \"XkbModel\" \"pc105\"
422 Option \"XkbLayout\" \"${XKEYBOARD},us\"
423 # Option \"XkbVariant\" \"nodeadkeys\""
426 # check for font path
427 if [ -d /usr/share/fonts/X11 ] ; then
428 XFONTS=" FontPath \"/usr/share/fonts/X11/misc\"
429 FontPath \"/usr/share/fonts/X11/cyrillic\"
430 FontPath \"/usr/share/fonts/X11/100dpi/:unscaled\"
431 FontPath \"/usr/share/fonts/X11/75dpi/:unscaled\"
432 FontPath \"/usr/share/fonts/X11/Type1\"
433 FontPath \"/usr/share/fonts/X11/100dpi\"
434 FontPath \"/usr/share/fonts/X11/75dpi\""
436 if [ -d /usr/X11R6/lib/X11/fonts ] ; then
438 FontPath \"/usr/X11R6/lib/X11/fonts/misc:unscaled\"
439 FontPath \"/usr/X11R6/lib/X11/fonts/misc\"
440 FontPath \"/usr/X11R6/lib/X11/fonts/75dpi:unscaled\"
441 FontPath \"/usr/X11R6/lib/X11/fonts/75dpi\"
442 FontPath \"/usr/X11R6/lib/X11/fonts/100dpi:unscaled\"
443 FontPath \"/usr/X11R6/lib/X11/fonts/100dpi\""
446 if [[ "$XKEYBOARD" == de ]] ; then
448 Option \"XkbVariant\" \"nodeadkeys\""
451 print -n "$bold_color$fg[blue]Gathering hardware information: $fg[red]"
454 MONITOR=$(awk '/monitor.1:/{print $3}' $HWINFO_TMP)
455 if [[ $MONITOR != 'ddc' ]] ; then
459 if [ -z $MODULE ] ; then
460 MODULE="$(getBootParam xmodule 2>/dev/null)"
461 if [ -z "$MODULE" ] ; then
462 MODULE=$(grep 'XFree86 v4 Server Module:' "${HWINFO_TMP}" | head -1 | awk '{print $5}')
463 if [ -z "$MODULE" ] ; then
471 mouse # get mouse settings
472 VGA=$(lspci | grep VGA | sed 's/.*compatible controller: //' | head -1)
475 if [ -z $MODE ] ; then
476 B_MODE="$(getBootParam xmode 2>/dev/null)"
477 if [ -n "$B_MODE" ] ; then
478 MODES="Modes \"$B_MODE\""
481 if [ -z "$MODES" ] ; then
482 mode # get available modes
485 MODES="Modes \"$MODE\""
489 print "$fg[green]done$reset_color"
492 print "$bg[black]$fg[white]$bold_color"
493 print "$fg[green]Specified windowmanager is $fg[yellow]$WINDOWMANAGER"
494 print "$fg[green]Video is $fg[yellow]$VGA$fg[green] using $bg[black]$fg[yellow]${XSERVER}$fg[cyan](${MODULE})$fg[green] Server"
495 [[ -z $HSYNC ]] && [[ -z $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR"
496 [[ -z $HSYNC ]] && [[ -n $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], VSYNC: $fg[yellow]$VSYNC"
497 [[ -z $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC"
498 [[ -n $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC $fg[green]VSYNC: $fg[yellow]$VSYNC"
499 [[ -n $modes ]] && print "$fg[green]Using default X.org modes."
500 [[ -z $modes ]] && print "$fg[green]Using Mode: $fg[yellow]$MODE"
501 # [[ -n $MODE ]] && print "$fg[green]Using Mode: $fg[yellow]$MODE"
502 # [[ -z $MODE ]] && print "$fg[green]Using default modes."
503 print "${reset_color}"
504 # if [[ $module[1] != ./. ]]; then module="$PWD/$module"; fi
509 # check for requirements {{{
512 if ! [ -x $(which hwinfo) ] ; then
513 print "$bg[black]$fg[red]${bold_color}Error: hwinfo not found in path.${reset_color}
514 Note: run 'apt-get install hwinfo' on systems running debian.
515 Exiting.${reset_color}"
519 if ! [[ -d /sys ]] ; then
520 print "$bg[black]$fg[red]${bold_color}Error: mounted /sys required (for hwinfo).${reset_color}
521 You may want to add the following line to your /etc/fstab:
523 sysfs /sys sysfs defaults 0 0
525 or just run 'mount /sys'. Exiting.${reset_color}"
535 ################################################################################
537 # Purpose: config file for xserver - generated by grml-x
538 # Bug-Reports: see http://grml.org/bugs/
539 # Latest change: ${DATE}
541 # /usr/share/doc/xserver-xorg/ and
542 # http://wiki.x.org/wiki/Home and
543 # http://ftp.x.org/pub/X11R7.0/doc/html/index.html for information on Xorg
544 # /usr/share/doc/xfree86-common/ for information on XFree86
545 # Refer to the xorg.conf man page and to
546 # http://ftp.x.org/pub/X11R7.0/doc/html/xorg.conf.5.html
547 # for details about the format of this file.
549 # If you would like this file to be automatically reconfigured by debian,
550 # run the following command:
551 # sudo dpkg-reconfigure -phigh xserver-xorg
552 ################################################################################
554 Section "ServerLayout"
555 Identifier "XServer Configured"
556 Screen 0 "Screen0" 0 0
557 InputDevice "Keyboard0" "CoreKeyboard"
561 Section "ServerFlags"
562 Option "AllowMouseOpenFail" "true" # allows the server to start up even if the mouse does not work
563 Option "DontVTSwitch" "false" # allow switching between virtual terminal
564 # Option "DontZap" "true" # disable <Crtl><Alt><BS> (server abort)
565 # Option "DontZoom" "true" # disable <Crtl><Alt><KP_+>/<KP_-> (resolution switching)
569 # RgbPath "/usr/X11R6/lib/X11/rgb"
570 # ModulePath "/usr/X11R6/lib/modules"
571 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/fonts.html
574 # FontPath "/usr/X11R6/lib/X11/fonts/Speedo"
575 # FontPath "/usr/X11R6/lib/X11/fonts/PEX"
576 # FontPath "/usr/X11R6/lib/X11/fonts/encodings"
577 # FontPath "/usr/X11R6/lib/X11/fonts/Type1
578 # FontPath "/usr/X11R6/lib/X11/fonts/util
579 # Additional fonts: Locale, Gimp, TTF...
580 # FontPath "/usr/X11R6/lib/X11/fonts/cyrillic"
581 # FontPath "/usr/X11R6/lib/X11/fonts/latin2/75dpi"
582 # FontPath "/usr/X11R6/lib/X11/fonts/latin2/100dpi"
583 # True type and type1 fonts are also handled via xftlib, see /etc/X11/XftConfig!
584 FontPath "/usr/X11R6/lib/X11/fonts/Type1"
585 FontPath "/usr/share/fonts/ttf/western"
586 FontPath "/usr/share/fonts/ttf/decoratives"
587 # FontPath "/usr/share/fonts/truetype"
588 # FontPath "/usr/share/fonts/truetype/openoffice"
589 FontPath "/usr/share/fonts/truetype/ttf-bitstream-vera"
590 # FontPath "/usr/share/fonts/truetype/latex-xft-fonts"
591 FontPath "/usr/share/fonts/latex-ttf-fonts"
592 FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
593 # FontPath "/usr/X11R6/lib/X11/fonts/defoma/TrueType"
594 # FontPath "/usr/X11R6/lib/X11/fonts/defoma/CID"
597 # Modules - see /usr/X11R6/lib/modules/fonts and /usr/X11R6/lib/modules/extensions
599 Load "dbe" # double buffer extension
600 Load "dri" # direct rendering
601 Load "glx" # 3D layer
602 Load "type1" # font module
603 Load "freetype" # font rendering
604 Load "extmod" # some commonly used server extensions (e.g. shape extension)
605 Load "record" # recording extension
606 # Load "vbe" # Vesa BIOS Extension
607 # Load "ddc" # ddc probing of monitor
608 # Load "bitmap" # bitmap fonts
609 # Load "GLcore" # render OpenGL in software
610 # Load "i2c" # I2C bus
611 # Load "int10" # initialize graphics cards via int10 call to the BIOS
612 # Load "speedo" # font module
613 # Load "v4l" # Video for Linux
614 # Load "evdev" # generic input handling driver on Linux
615 # Valid entries - see /usr/lib/xorg/modules/[extensions/]
616 # afb bitmap cfb cfb16 cfb24 cfb32 cw damage dbe ddc dri drm extmod fb
617 # fbdevhw freetype GLcore glx i2c int10 int10 layer mfb pcidata rac ramdac
618 # record scanpci shadow shadowfb type1 vbe vgahw xaa xf1bpp xf24_32bpp xf4bpp
619 # xf8_16bpp xf8_32bpp xtrap
622 # If you'd like to switch the positions of your capslock and control keys, use:
623 # Option "XkbOptions" "ctrl:swapcaps"
624 # Or if you just want both to be control, use:
625 # Option "XkbOptions" "ctrl:nocaps"
626 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/XKB-Config.html
627 Section "InputDevice"
628 Identifier "Keyboard0"
629 Option "CoreKeyboard"
631 # Option "XkbOptions" "ctrl:swapcaps,grp:alt_shift_toggle,grp_led:scroll,compose:menu"
634 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/mouse.html
641 Identifier "Monitor0"
642 # ModelName "Old Monitor (no DDC)"
644 # HorizSync 28.0 - 78.0 # Warning: This may fry very old Monitors
645 # HorizSync 28.0 - 96.0 # Warning: This may fry old Monitors
647 # VertRefresh 50.0 - 76.0 # Very conservative. May flicker.
648 # VertRefresh 50.0 - 60.0 # Extreme conservative. Will flicker. TFT default.
650 # Need more information?
651 # http://xtiming.sourceforge.net/cgi-bin/xtiming.pl
652 # http://en.tldp.org/HOWTO/XFree86-Video-Timings-HOWTO/
656 ### Available Driver options are:
657 ## sw_cursor is needed for some ati and radeon cards
666 # Option "RenderAccel" "true"
667 # Option "AllowGLXWithComposite" "true"
669 # The following line is auto-generated by grml-x
673 ## Workaround for drivers which send output to wrong device:
674 # Option "MonitorLayout" "LVDS, AUTO"
675 # Option "MonitorLayout" "LVDS, CRT"
676 # Option "MonitorLayout" "NONE, STV"
677 # Option "MonitorLayout" "LVDS"
721 #Section "Extensions"
722 # Option "Composite" "Enable"
725 ## END OF FILE #################################################################
732 XCONFTMP="/tmp/xconfig.$$"
734 [ -f $XCONFIG ] && sudo mv -f $XCONFIG $XCONFIG.old
735 sudo mv $XCONFTMP $XCONFIG
736 sudo chown root.root $XCONFIG
737 sudo chmod 644 $XCONFIG
744 if [[ ! -f $XCONFIG ]] ; then
745 print -n "$bold_color$fg[blue]Creating $XCONFIG: $fg[red]"
746 writeit && print "$fg[green]done$reset_color"
748 print "$bold_color$fg[blue]Notice: $XCONFIG exists already.
749 Use the force-option (-force) to force creation.
752 if [[ -n "$FORCE" ]] ; then
753 print "$bold_color$fg[blue]Force-switch or manual option(s) detected -"
754 print -n "moving eventual existing $XCONFIG to ${XCONFIG}.old: $fg[red]"
755 writeit && print "$fg[green]done$reset_color"
764 if [ -z $NOSTART ] ; then
766 if [ -x /etc/init.d/xorg-common ] ; then
767 sudo /etc/init.d/xorg-common start
769 if [ -x /etc/init.d/xfree86-common ] ; then
770 sudo /etc/init.d/xfree86-common start
774 if [ -z $DISPLAY ] ; then
775 print "$bold_color$fg[green]Now trying to run startx.$reset_color"
776 startx ~/.xinitrc -- $XOPTS
778 print "$bold_color$fg[green]Now trying to run startx on display $DISPLAY.$reset_color"
779 startx ~/.xinitrc -- :$DISPLAY $XOPTS
782 print "$bold_color$fg[blue]Not running startx as requested as option.$reset_color"
792 if [ $UID != 0 ] ; then
793 if [[ $(tty) == /dev/pts/* ]] ; then
794 print "It seems you are running $PROGRAMNAME from inside GNU screen.
795 Notice that this might fail if running as user grml!
796 Please exit screen and try to run $PROGRAMNAME again."
800 Problems? Run the following commands for getting information on your hardware:
802 discover -v --data-path=xfree86/server/device/driver display
803 xdebconfigurator -c -d -i -x
804 get-edid | parse-edid
806 Do you want to go the debian way of life? Run:
807 apt-get install x-window-system-core read-edid mdetect hwinfo xdebconfigurator
808 dpkg-reconfigure x-window-system-core (or xserver-xfree86 or xserver-xorg depending on your system)
810 Problems with the module used for X? Try to load another one or
811 fall back to module vesa:
812 $PROGRAMNAME -module radeon ...
813 $PROGRAMNAME -module vesa ...
815 Do you want to deactivate a present synaptics touchpad? Run:
816 $PROGRAMNAME -nosynaptics ...
818 Your monitor is very old and/or does not support DDC-probing?
819 $PROGRAMNAME -noddc ...
821 Do you want to create a x configuration file but do not start X?
822 $PROGRAMNAME -nostart ...
824 Monitor frequency too high or too low? Just specify hsync/vsync manually:
825 $PROGRAMNAME -hsync 30-65 ...
826 $PROGRAMNAME -hsync 30-65 -vsync 50-60 ...
828 Want to adjust the resolution? Use the mode-switch:
829 $PROGRAMNAME -mode 1024x768 ...
830 $PROGRAMNAME -mode '1280x1024 1024x768' ...
832 To adjust resolution while running X execute:
835 More information on grml-x can be found in the manual page: man grml-x
837 Report bugs, send wishes and feedback to the grml team:
838 http://grml.org/bugs/ - contact (at) grml.org
840 print -n "$reset_color"
856 if [ -w $XINITRC ] ; then
857 sed -i "s|^[^#]*exec.*| exec $WINDOWMANAGER|g" $XINITRC
860 echo -e "#!/bin/sh\n exec $WINDOWMANAGER" >> $XINITRC
865 ## END OF FILE #################################################################
866 # vim:foldmethod=marker