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: Mon Mär 26 21:26:31 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 ] ; then
26 source /etc/grml/script-functions
28 echo 'Error: sourcing /etc/grml/script-functions failed. Exiting.'
32 check4root && ROOT='1' || ROOT=''
37 HWINFO='/usr/sbin/hwinfo'
39 [ -n "$XINITRC" ] || XINITRC="$HOME/.xinitrc"
42 HWINFO_TMP="/tmp/hwinfo.$$"
43 MONITORINFO="/tmp/monitorinfo.$$"
44 MOUSEINFO="/tmp/mouse.$$"
46 if [ -r /etc/sysconfig/keyboard ] ; then
47 source /etc/sysconfig/keyboard
53 XCONFIG='/etc/X11/xorg.conf'
54 KEYBOARD="Driver \"kbd\"
55 # Option \"XkbRules\" \"xfree86\"
56 Option \"XkbRules\" \"xorg\"
57 Option \"XkbModel\" \"pc105\"
58 Option \"XkbLayout\" \"${XKEYBOARD},us\"
59 # Option \"XkbVariant\" \"nodeadkeys\""
62 if [ -d /usr/share/fonts/X11 ] ; then
63 XFONTS=" FontPath \"/usr/share/fonts/X11/misc\"
64 FontPath \"/usr/share/fonts/X11/100dpi/:unscaled\"
65 FontPath \"/usr/share/fonts/X11/75dpi/:unscaled\"
66 FontPath \"/usr/share/fonts/X11/Type1\"
67 FontPath \"/usr/share/fonts/X11/100dpi\"
68 FontPath \"/usr/share/fonts/X11/75dpi\""
70 # /usr/X11R6/lib/X11/fonts exists nearly everywhere, assume
71 # /usr/X11R6/lib/X11/fonts as valid font path only if fonts.dir
73 if [ -r /usr/X11R6/lib/X11/fonts/misc/fonts.dir ] ; then
75 FontPath \"/usr/X11R6/lib/X11/fonts/Type1\"
76 FontPath \"/usr/X11R6/lib/X11/fonts/misc:unscaled\"
77 FontPath \"/usr/X11R6/lib/X11/fonts/misc\"
78 FontPath \"/usr/X11R6/lib/X11/fonts/75dpi:unscaled\"
79 FontPath \"/usr/X11R6/lib/X11/fonts/75dpi\"
80 FontPath \"/usr/X11R6/lib/X11/fonts/100dpi:unscaled\"
81 FontPath \"/usr/X11R6/lib/X11/fonts/100dpi\""
85 # make sure we don't leave any temp files {{{
87 rm -f "$HWINFO_TMP" "$MONITORINFO" "$MOUSEINFO"
88 [ -n "$1" ] && EXIT="$1" || EXIT="1"
89 print "$bg[black]$fg[red]${bold_color}Exiting...${reset_color}">&2
96 # warn if running as user root {{{
97 if [ -n "$ROOT" ] ; then
98 if [ -r /etc/grml_cd ] ; then
99 print "$bg[black]$fg[red]${bold_color}Warning: Please do not run grml-x as user root.${reset_color}"
100 print "$bg[black]$fg[red]${bold_color}Running grml-x as user root is *not* supported!${reset_color}"
101 print "$bg[black]$fg[red]${bold_color}Switch to user grml or run su - grml -c 'grml-x ...' instead.${reset_color}"
104 print "$bg[black]$fg[red]${bold_color}Warning: Please do not run X.org as user root!${reset_color}"
105 print "$bg[black]$fg[red]${bold_color}As soon as you have a working $XCONFIG please use startx instead of grml-x.${reset_color}"
109 fstabuser=$(grep ':x:1000:' /etc/passwd)
110 fstabuser=${fstabuser%%[:]*}
113 # usage information {{{
116 if [[ $1 != '' ]] ; then echo 1>&2 "\n$1" ; fi
117 print "$bg[black]$fg[red]$bold_color"
120 $PROGRAMNAME [-options] windowmanager
126 $PROGRAMNAME -force -nostart fluxbox
127 $PROGRAMNAME -nosynaptics fluxbox
128 $PROGRAMNAME -nosync fluxbox
129 $PROGRAMNAME -noddc wmii
130 $PROGRAMNAME -nousb fluxbox
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')
169 if [[ -n $NODDC ]] ; then
170 MODES='Modes "1024x768" "800x600" "640x480" "1600x1200" "1280x1024" "1280x960"'
171 elif [[ "$modes" == "\"1024x768\" " || -z $modes ]] ; then
172 MODES='# Modes "1024x768" "800x600" "640x480" "1600x1200" "1280x1024" "1280x960"'
174 MODES="# Modes $modes"
179 # sync - get hsync/vsync settings {{{
182 [ -r "$MONITORINFO" ] || monitor # get monitor settings
183 vsyncval=$(awk '/Vert. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
184 hsyncval=$(awk '/Hor. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
185 if [ -z $vsyncval ] ; then
186 vsyncval='50.0 - 60.0'
188 if [ -z $hsyncval ] ; then
189 hsyncval='28.0 - 96.0'
197 sudo $HWINFO --mouse > $MOUSEINFO
199 # SynPS/2 Synaptics TouchPad
200 if grep -q 'Device:.*Synaptics' "$MOUSEINFO" ; then
201 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
202 MOUSEDRIVER='synaptics'
203 SYNMOUSE='InputDevice "Synaptics" "AlwaysCore"'
205 Section \"InputDevice\"
207 Identifier \"Synaptics\"
208 Option \"Device\" \"/dev/psaux\"
209 Option \"Protocol\" \"auto-dev\"
210 Option \"LeftEdge\" \"1700\"
211 Option \"RightEdge\" \"5300\"
212 Option \"TopEdge\" \"1700\"
213 Option \"BottomEdge\" \"4200\"
214 Option \"FingerLow\" \"25\"
215 Option \"FingerHigh\" \"30\"
216 Option \"ZAxisMapping\" \"4 5\"
217 Option \"MaxTapTime\" \"180\"
218 Option \"MaxTapMove\" \"220\"
219 Option \"VertScrollDelta\" \"100\"
220 Option \"MinSpeed\" \"0.06\"
221 Option \"MaxSpeed\" \"0.12\"
222 Option \"AccelFactor\" \"0.0010\"
223 # Option \"SHMConfig\" \"on\"
224 # Option \"Repeater\" \"/dev/ps2mouse\"
230 SYNMOUSE='# No synaptics touchpad detected.'
234 # AlpsPS/2 ALPS TouchPad (with Synapticsdriver)
235 if grep -q 'Device:.*ALPS' "$MOUSEINFO" ; then
236 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
237 MOUSEDRIVER='synaptics'
238 # SYNMOUSE='InputDevice "Synaptics" "CorePointer"'
239 SYNMOUSE='InputDevice "Synaptics" "AlwaysCore"'
241 Section \"InputDevice\"
243 Identifier \"Synaptics\"
244 Option \"Device\" \"/dev/psaux\"
245 Option \"Protocol\" \"auto-dev\"
246 Option \"LeftEdge\" \"120\"
247 Option \"RightEdge\" \"850\"
248 Option \"TopEdge\" \"120\"
249 Option \"BottomEdge\" \"650\"
250 Option \"FingerLow\" \"14\"
251 Option \"FingerHigh\" \"15\"
252 Option \"ZAxisMapping\" \"4 5\"
253 Option \"MaxTapTime\" \"180\"
254 Option \"MaxTapMove\" \"50\"
255 Option \"MaxDoubleTapTime\" \"100\"
256 Option \"VertScrollDelta\" \"20\"
257 Option \"HorizScrollDelta\" \"20\"
258 Option \"MinSpeed\" \"0.3\"
259 Option \"MaxSpeed\" \"2.00\"
260 Option \"AccelFactor\" \"0.030\"
261 Option \"UpDownScrolling\" \"1\"
262 Option \"EmulateMiddleButtonTime\" \"75\"
263 Option \"CircularScrolling\" \"1\"
264 Option \"CircScrollDelta\" \"0.1\"
265 Option \"CircScrollTrigger\" \"8\"
266 # Option \"SHMConfig\" \"on\"
267 # Option \"Repeater\" \"/dev/ps2mouse\"
273 SYNMOUSE='# No alps touchpad detected.'
276 SYNMOUSE='# No alps touchpad present.'
280 # USB-PS/2 Optical Mouse
281 if ! [[ -n $NOUSB ]] ; then
283 USBMOUSE='InputDevice "USB Mouse" "CorePointer"'
285 Section \"InputDevice\"
286 Identifier \"USB Mouse\"
288 Option \"Device\" \"/dev/input/mice\"
289 Option \"Protocol\" \"auto\"
290 Option \"ZAxisMapping\" \"4 5\"
291 Option \"Buttons\" \"5\"
292 Option \"SendCoreEvents\" \"true\"
296 USBMOUSE='# Deactivated USB Mouse as requested.'
299 if grep -q 'Device:.*Serial' "$MOUSEINFO" ; then
301 SERMOUSE='InputDevice "Serial Mouse" "CorePointer"'
303 Section \"InputDevice\"
304 Identifier \"Serial Mouse\"
306 Option \"Device\" \"/dev/ttyS0\"
307 Option \"Protocol\" \"Microsoft\"
308 Option \"Emulate3Buttons\" \"true\"
309 Option \"Emulate3Timeout\" \"70\"
310 Option \"SendCoreEvents\" \"true\"
314 SERMOUSE='# No serial mouse detected.'
317 # ImExPS/2 Logitech Explorer Mouse
318 # "PS2++ Logitech MX Mouse"
319 if ! [[ -n $NOPS2 ]] ; then
320 if grep -qE 'Device:.*PS.?2' "$MOUSEINFO" ; then
322 PS2MOUSE='InputDevice "PS/2 Mouse" "CorePointer"'
324 Section \"InputDevice\"
325 Identifier \"PS/2 Mouse\"
327 Option \"Device\" \"/dev/input/mice\"
328 # Option \"Device\" \"/dev/psaux\"
329 Option \"Protocol\" \"PS/2\"
330 Option \"Emulate3Buttons\" \"true\"
331 Option \"Emulate3Timeout\" \"70\"
332 Option \"SendCoreEvents\" \"true\"
336 PS2MOUSE='# No PS/2 mouse detected.'
340 PS2MOUSE='# Deactivated PS/2 Mouse as requested.'
343 if [[ -n $GENERICMOUSE ]] ; then
345 GENERICMOUSE='InputDevice "Generic Mouse" "CorePointer"'
347 Section \"InputDevice\"
348 Identifier \"Generic Mouse\"
350 Option \"Device\" \"/dev/input/mice\"
351 Option \"Protocol\" \"auto\"
352 Option \"Buttons\" \"5\"
353 Option \"ZAxisMapping\" \"4 5\"
357 GENERICMOUSE='# No generic mouse configured.'
368 # commandline parsing {{{
371 zparseopts -K -- module:=o_module help=o_help noddc=o_noddc nosync=o_nosync \
372 vsync:=o_vsync hsync:=o_hsync mode:=o_mode force=o_force display:=o_display \
373 nostart=o_nostart nodpms=o_nodpms nosynaptics=o_nosynaptics nousb=o_nousb \
374 nops2=o_nops2 genmouse=o_genmouse novref=o_novref nohsync=o_nohsync \
377 if [[ $# == 0 || "$o_help" != "" || "$1" == '-h' || "$1" == '--help' ]]; then
381 if [[ "$o_force" != "" ]]; then
385 if [[ "$o_fallback" != "" ]]; then
387 if [ -r /etc/X11/xorg.conf.example ] ; then
388 sudo cp /etc/X11/xorg.conf.example $XCONFIG
389 print "$bold_color$fg[blue]Copying /etc/X11/xorg.conf.example to $XCONFIG as requested via fallback option."
391 echo 'Error: /etc/X11/xorg.conf.example not readable, exiting.'
396 if [[ "$o_nodpms" != "" ]]; then
397 DPMS='Option "DPMS" "false"'
399 DPMS='Option "DPMS" "true"'
402 if [[ "$o_noddc" != "" ]]; then
406 if [[ "$o_vsync" != "" ]]; then
410 if [[ "$o_hsync" != "" ]]; then
414 if [[ "$o_nousb" != "" ]]; then
418 if [[ "$o_nops2" != "" ]]; then
422 if [[ "$o_genmouse" != "" ]]; then
426 if [[ "$o_nosynaptics" != "" ]]; then
432 if [[ "$o_nostart" != "" ]]; then
436 DISPLAY=$o_display[2]
438 eval WINDOWMANAGER=\${$#}
440 if [[ "$XKEYBOARD" == de ]] ; then
442 Option \"XkbVariant\" \"nodeadkeys\""
445 if [ -n "$FORCE" -o ! -r "$XCONFIG" -a -z "$FALLBACK" ] ; then
446 print -n "$bold_color$fg[blue]Gathering hardware information...$fg[red]"
448 sync # get hsync/vsync
450 if [ -z "$o_hsync" ] ; then
451 o_hsync=(-hsync "$hsyncval")
453 HORIZSYNC=" HorizSync $HSYNC"
455 o_hsync=(-hsync "$o_hsync[2]")
457 HORIZSYNC=" HorizSync $HSYNC"
460 if [ -z "$o_vsync" ] ; then
461 o_vsync=(-vsync "$vsyncval")
463 VERTISYNC=" VertRefresh $VSYNC"
465 o_vsync=(-vsync "$o_vsync[2]")
467 VERTISYNC=" VertRefresh $VSYNC"
470 if [[ "$o_nosync" != "" ]]; then
471 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nosync option of grml-x"
472 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -nosync option of grml-x"
475 if [[ "$o_nohsync" != "" ]]; then
476 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nohsync option of grml-x"
479 if [[ "$o_novref" != "" ]]; then
480 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -novref option of grml-x"
487 MONITOR=$(awk '/monitor.1:/{print $3}' $HWINFO_TMP)
488 [[ $MONITOR != 'ddc' ]] && NODDC=yes
492 if [ -z "$MODULE" ] ; then
493 MODULE="$(getbootparam xmodule 2>/dev/null)"
494 if [ -z "$MODULE" ] ; then
495 MODULE=$(grep 'XFree86 v4 Server Module:' "${HWINFO_TMP}" | head -1 | awk '{print $5}')
496 if [ -z "$MODULE" ] ; then
499 # hwinfo >=13.28 reports driver 'intel' instead of i810
500 if [[ "$MODULE" == 'intel' ]] ; then
501 [ -r /usr/lib/xorg/modules/drivers/intel_drv.so ] || MODULE='i810'
508 mouse # get mouse settings
509 VGA=$(lspci | grep VGA | sed 's/.*compatible controller: //' | head -1)
512 if [ -z $MODE ] ; then
513 B_MODE="$(getbootparam xmode 2>/dev/null)"
514 if [ -n "$B_MODE" ] ; then
515 MODES="Modes \"$B_MODE\""
518 if [ -z "$MODES" ] ; then
519 mode # get available modes
522 MODES="Modes \"$MODE\""
526 print "$fg[green]done$reset_color"
527 print "$bg[black]$fg[white]$bold_color"
528 print "$fg[green]Specified windowmanager is $fg[yellow]$WINDOWMANAGER"
529 print "$fg[green]Video is $fg[yellow]$VGA$fg[green] using $bg[black]$fg[yellow]${XSERVER}$fg[cyan](${MODULE})$fg[green] Server"
530 [[ -z $HSYNC ]] && [[ -z $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR"
531 [[ -z $HSYNC ]] && [[ -n $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], VSYNC: $fg[yellow]$VSYNC"
532 [[ -z $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC"
533 [[ -n $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC $fg[green]VSYNC: $fg[yellow]$VSYNC"
534 [[ -n $modes ]] && print "$fg[green]Using default X.org modes."
535 [[ -z $modes ]] && print "$fg[green]Using Mode: $fg[yellow]$MODE"
536 print "${reset_color}"
542 # check for requirements {{{
545 if ! [ -x $(which hwinfo) ] ; then
546 print "$bg[black]$fg[red]${bold_color}Error: hwinfo not found in path.${reset_color}
547 Note: run 'apt-get install hwinfo' on systems running debian.
548 Exiting.${reset_color}"
552 if ! [[ -d /sys ]] ; then
553 print "$bg[black]$fg[red]${bold_color}Error: mounted /sys required (for hwinfo).${reset_color}
554 You may want to add the following line to your /etc/fstab:
556 sysfs /sys sysfs defaults 0 0
558 or just run 'mount /sys'. Exiting.${reset_color}"
568 ################################################################################
570 # Purpose: config file for xserver - generated by grml-x
571 # Bug-Reports: see http://grml.org/bugs/
572 # Latest change: ${DATE}
574 # /usr/share/doc/xserver-xorg/ and
575 # http://wiki.x.org/wiki/Home and
576 # http://ftp.x.org/pub/X11R7.0/doc/html/index.html for information on Xorg
577 # Refer to the xorg.conf man page and to
578 # http://ftp.x.org/pub/X11R7.0/doc/html/xorg.conf.5.html
579 # for details about the format of this file.
581 # If you would like this file to be automatically reconfigured by debian,
582 # run the following command:
583 # sudo dpkg-reconfigure -phigh xserver-xorg
584 ################################################################################
586 Section "ServerLayout"
587 Identifier "XServer Configured"
588 Screen 0 "Screen0" 0 0
589 InputDevice "Keyboard0" "CoreKeyboard"
593 Section "ServerFlags"
594 Option "AllowMouseOpenFail" "true" # allows the server to start up even if the mouse does not work
595 Option "DontVTSwitch" "false" # allow switching between virtual terminal
596 # Option "DontZap" "true" # disable <Crtl><Alt><BS> (server abort)
597 # Option "DontZoom" "true" # disable <Crtl><Alt><KP_+>/<KP_-> (resolution switching)
601 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/fonts.html
603 # FontPath "/usr/share/fonts/ttf/western"
604 # FontPath "/usr/share/fonts/ttf/decoratives"
605 FontPath "/usr/share/fonts/truetype/ttf-bitstream-vera"
606 FontPath "/usr/share/fonts/latex-ttf-fonts"
607 FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
610 # Modules - see /usr/X11R6/lib/modules/fonts and /usr/X11R6/lib/modules/extensions
612 Load "dbe" # double buffer extension
613 Load "dri" # direct rendering
614 Load "glx" # 3D layer
615 Load "type1" # font module
616 Load "freetype" # font rendering
617 Load "extmod" # some commonly used server extensions (e.g. shape extension)
618 Load "record" # recording extension
619 # Load "vbe" # Vesa BIOS Extension
620 # Load "ddc" # ddc probing of monitor
621 # Load "bitmap" # bitmap fonts
622 # Load "GLcore" # render OpenGL in software
623 # Load "i2c" # I2C bus
624 # Load "int10" # initialize graphics cards via int10 call to the BIOS
625 # Load "speedo" # font module
626 # Load "v4l" # Video for Linux
627 # Load "evdev" # generic input handling driver on Linux
628 # Valid entries - see /usr/lib/xorg/modules/[extensions/]
629 # afb bitmap cfb cfb16 cfb24 cfb32 cw damage dbe ddc dri drm extmod fb
630 # fbdevhw freetype GLcore glx i2c int10 int10 layer mfb pcidata rac ramdac
631 # record scanpci shadow shadowfb type1 vbe vgahw xaa xf1bpp xf24_32bpp xf4bpp
632 # xf8_16bpp xf8_32bpp xtrap
635 # If you'd like to switch the positions of your capslock and control keys, use:
636 # Option "XkbOptions" "ctrl:swapcaps"
637 # Or if you just want both to be control, use:
638 # Option "XkbOptions" "ctrl:nocaps"
639 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/XKB-Config.html
640 Section "InputDevice"
641 Identifier "Keyboard0"
642 Option "CoreKeyboard"
644 # Option "XkbOptions" "ctrl:swapcaps,grp:alt_shift_toggle,grp_led:scroll,compose:menu"
647 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/mouse.html
654 Identifier "Monitor0"
655 # ModelName "Old Monitor (no DDC)"
657 # HorizSync 28.0 - 78.0 # Warning: This may fry very old Monitors
658 # HorizSync 28.0 - 96.0 # Warning: This may fry old Monitors
660 # VertRefresh 50.0 - 76.0 # Very conservative. May flicker.
661 # VertRefresh 50.0 - 60.0 # Extreme conservative. Will flicker. TFT default.
663 # Need more information?
664 # http://xtiming.sourceforge.net/cgi-bin/xtiming.pl
665 # http://en.tldp.org/HOWTO/XFree86-Video-Timings-HOWTO/
669 ### Available Driver options are:
670 ## sw_cursor is needed for some ati and radeon cards
679 # Option "RenderAccel" "true"
680 # Option "AllowGLXWithComposite" "true"
682 # The following line is auto-generated by grml-x
686 ## Workaround for drivers (for example radeon) which might send output to wrong device:
687 # Option "MonitorLayout" "LVDS, AUTO"
688 # Option "MonitorLayout" "LVDS, CRT"
689 # Option "MonitorLayout" "NONE, STV"
690 # Option "MonitorLayout" "LVDS"
734 #Section "Extensions"
735 # Option "Composite" "Enable"
738 ## END OF FILE #################################################################
745 XCONFTMP="/tmp/xconfig.$$"
747 [ -f $XCONFIG ] && sudo mv -f $XCONFIG $XCONFIG.old
748 sudo mv $XCONFTMP $XCONFIG
749 sudo chown root.root $XCONFIG
750 sudo chmod 644 $XCONFIG
757 if [[ ! -f $XCONFIG ]] ; then
758 print -n "$bold_color$fg[blue]Creating $XCONFIG: $fg[red]"
759 writeit && print "$fg[green]done$reset_color"
761 if [ -z "$FORCE" -a -z "$FALLBACK" ] ; then
762 print "$bold_color$fg[blue]Notice: $XCONFIG exists already.
763 Use the force-option (-force) to force creation.
767 if [[ -n "$FORCE" ]] ; then
768 print "$bold_color$fg[blue]Force-switch or manual option(s) detected:"
769 print -n "\-> Moving eventual existing $XCONFIG to ${XCONFIG}.old: $fg[red]"
770 writeit && print "$fg[green]done$reset_color"
779 if [ -z "$NOSTART" ] ; then
781 if [ -x /etc/init.d/xorg-common ] ; then
782 sudo /etc/init.d/xorg-common start
784 if [ -x /etc/init.d/xfree86-common ] ; then
785 sudo /etc/init.d/xfree86-common start
789 if [ -z "$DISPLAY" ] ; then
790 print "$bold_color$fg[green]Now trying to run startx.$reset_color"
791 startx ~/.xinitrc -- $XOPTS
793 print "$bold_color$fg[green]Now trying to run startx on display $DISPLAY.$reset_color"
794 startx ~/.xinitrc -- :$DISPLAY $XOPTS
797 print "$bold_color$fg[blue]Not running startx as requested via option.$reset_color"
807 if [ -z "$ROOT" ] ; then
808 if [[ $(tty) == /dev/pts/* ]] ; then
809 print "It seems you are running $PROGRAMNAME from inside GNU screen.
810 Notice that this might fail if running as user grml!
811 Please exit screen and try to run $PROGRAMNAME again."
814 print "Run the following commands for getting information on your hardware:
816 discover -v --data-path=xfree86/server/device/driver display
817 xdebconfigurator -c -d -i -x
818 get-edid | parse-edid
820 Do you want to go the debian way of life? Run:
821 apt-get install x-window-system-core read-edid mdetect hwinfo xdebconfigurator
822 dpkg-reconfigure x-window-system-core (or xserver-xorg depending on your system)
824 Problems with the module used for X? Try to load another one or
825 fall back to module vesa:
826 $PROGRAMNAME -module radeon ...
827 $PROGRAMNAME -module vesa ...
829 Do you want to deactivate a present synaptics touchpad? Run:
830 $PROGRAMNAME -nosynaptics ...
832 Your monitor is very old and/or does not support DDC-probing?
833 $PROGRAMNAME -noddc ...
835 Do you want to create a x configuration file but do not start X?
836 $PROGRAMNAME -nostart ...
838 Monitor frequency too high or too low? Just specify hsync/vsync manually:
839 $PROGRAMNAME -hsync 30-65 ...
840 $PROGRAMNAME -hsync 30-65 -vsync 50-60 ...
842 Want to adjust the resolution? Use the mode-switch:
843 $PROGRAMNAME -mode 1024x768 ...
844 $PROGRAMNAME -mode '1280x1024 1024x768' ...
846 Problems? Use vesa with resolution 1024x768:
847 $PROGRAMNAME -module vesa -mode 1024x768 ...
849 Still problems with X? Use the fallback option:
850 $PROGRAMNAME -fallback ...
852 To adjust resolution while running X execute:
855 More information on grml-x can be found in the manual page: man grml-x
857 Report bugs, send wishes and feedback to the grml team:
858 http://grml.org/bugs/ - contact (at) grml.org
860 print -n "$reset_color"
876 if [ -w "$XINITRC" ] ; then
877 sed -i "s|^[^#]*exec.*| exec $WINDOWMANAGER|g" $XINITRC
880 echo -e "#!/bin/sh\n exec $WINDOWMANAGER" >> $XINITRC
885 ## END OF FILE #################################################################
886 # vim:foldmethod=marker