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 Aug 05 08:38:49 CEST 2006 [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}\"
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}\"
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 mode # get available modes
478 MODES="Modes \"$MODE\""
482 print "$fg[green]done$reset_color"
485 print "$bg[black]$fg[white]$bold_color"
486 print "$fg[green]Specified windowmanager is $fg[yellow]$WINDOWMANAGER"
487 print "$fg[green]Video is $fg[yellow]$VGA$fg[green] using $bg[black]$fg[yellow]${XSERVER}$fg[cyan](${MODULE})$fg[green] Server"
488 [[ -z $HSYNC ]] && [[ -z $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR"
489 [[ -z $HSYNC ]] && [[ -n $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], VSYNC: $fg[yellow]$VSYNC"
490 [[ -z $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC"
491 [[ -n $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC $fg[green]VSYNC: $fg[yellow]$VSYNC"
492 [[ -n $modes ]] && print "$fg[green]Using default X.org modes."
493 [[ -z $modes ]] && print "$fg[green]Using Mode: $fg[yellow]$MODE"
494 # [[ -n $MODE ]] && print "$fg[green]Using Mode: $fg[yellow]$MODE"
495 # [[ -z $MODE ]] && print "$fg[green]Using default modes."
496 print "${reset_color}"
497 # if [[ $module[1] != ./. ]]; then module="$PWD/$module"; fi
502 # check for requirements {{{
505 if ! [ -x $(which hwinfo) ] ; then
506 print "$bg[black]$fg[red]${bold_color}Error: hwinfo not found in path.${reset_color}
507 Note: run 'apt-get install hwinfo' on systems running debian.
508 Exiting.${reset_color}"
512 if ! [[ -d /sys ]] ; then
513 print "$bg[black]$fg[red]${bold_color}Error: mounted /sys required (for hwinfo).${reset_color}
514 You may want to add the following line to your /etc/fstab:
516 sysfs /sys sysfs defaults 0 0
518 or just run 'mount /sys'. Exiting.${reset_color}"
528 ################################################################################
530 # Purpose: config file for xserver - generated by grml-x
531 # Bug-Reports: see http://grml.org/bugs/
532 # Latest change: ${DATE}
534 # /usr/share/doc/xserver-xorg/ and
535 # http://wiki.x.org/wiki/Home and
536 # http://ftp.x.org/pub/X11R7.0/doc/html/index.html for information on Xorg
537 # /usr/share/doc/xfree86-common/ for information on XFree86
538 # Refer to the xorg.conf man page and to
539 # http://ftp.x.org/pub/X11R7.0/doc/html/xorg.conf.5.html
540 # for details about the format of this file.
542 # If you would like this file to be automatically reconfigured by debian,
543 # run the following command:
544 # sudo dpkg-reconfigure -phigh xserver-xorg
545 ################################################################################
547 Section "ServerLayout"
548 Identifier "XServer Configured"
549 Screen 0 "Screen0" 0 0
550 InputDevice "Keyboard0" "CoreKeyboard"
554 Section "ServerFlags"
555 Option "AllowMouseOpenFail" "true" # allows the server to start up even if the mouse does not work
556 Option "DontVTSwitch" "false" # allow switching between virtual terminal
557 # Option "DontZap" "true" # disable <Crtl><Alt><BS> (server abort)
558 # Option "DontZoom" "true" # disable <Crtl><Alt><KP_+>/<KP_-> (resolution switching)
562 # RgbPath "/usr/X11R6/lib/X11/rgb"
563 # ModulePath "/usr/X11R6/lib/modules"
564 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/fonts.html
567 # FontPath "/usr/X11R6/lib/X11/fonts/Speedo"
568 # FontPath "/usr/X11R6/lib/X11/fonts/PEX"
569 # FontPath "/usr/X11R6/lib/X11/fonts/encodings"
570 # FontPath "/usr/X11R6/lib/X11/fonts/Type1
571 # FontPath "/usr/X11R6/lib/X11/fonts/util
572 # Additional fonts: Locale, Gimp, TTF...
573 # FontPath "/usr/X11R6/lib/X11/fonts/cyrillic"
574 # FontPath "/usr/X11R6/lib/X11/fonts/latin2/75dpi"
575 # FontPath "/usr/X11R6/lib/X11/fonts/latin2/100dpi"
576 # True type and type1 fonts are also handled via xftlib, see /etc/X11/XftConfig!
577 FontPath "/usr/X11R6/lib/X11/fonts/Type1"
578 FontPath "/usr/share/fonts/ttf/western"
579 FontPath "/usr/share/fonts/ttf/decoratives"
580 # FontPath "/usr/share/fonts/truetype"
581 # FontPath "/usr/share/fonts/truetype/openoffice"
582 FontPath "/usr/share/fonts/truetype/ttf-bitstream-vera"
583 # FontPath "/usr/share/fonts/truetype/latex-xft-fonts"
584 FontPath "/usr/share/fonts/latex-ttf-fonts"
585 FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
586 # FontPath "/usr/X11R6/lib/X11/fonts/defoma/TrueType"
587 # FontPath "/usr/X11R6/lib/X11/fonts/defoma/CID"
590 # Modules - see /usr/X11R6/lib/modules/fonts and /usr/X11R6/lib/modules/extensions
592 Load "dbe" # double buffer extension
593 Load "dri" # direct rendering
594 Load "glx" # 3D layer
595 Load "type1" # font module
596 Load "freetype" # font rendering
597 Load "extmod" # some commonly used server extensions (e.g. shape extension)
598 Load "record" # recording extension
599 # Load "vbe" # Vesa BIOS Extension
600 # Load "ddc" # ddc probing of monitor
601 # Load "bitmap" # bitmap fonts
602 # Load "GLcore" # render OpenGL in software
603 # Load "i2c" # I2C bus
604 # Load "int10" # initialize graphics cards via int10 call to the BIOS
605 # Load "speedo" # font module
606 # Load "v4l" # Video for Linux
607 # Load "evdev" # generic input handling driver on Linux
608 # Valid entries - see /usr/lib/xorg/modules/[extensions/]
609 # afb bitmap cfb cfb16 cfb24 cfb32 cw damage dbe ddc dri drm extmod fb
610 # fbdevhw freetype GLcore glx i2c int10 int10 layer mfb pcidata rac ramdac
611 # record scanpci shadow shadowfb type1 vbe vgahw xaa xf1bpp xf24_32bpp xf4bpp
612 # xf8_16bpp xf8_32bpp xtrap
615 # If you'd like to switch the positions of your capslock and control keys, use:
616 # Option "XkbOptions" "ctrl:swapcaps"
617 # Or if you just want both to be control, use:
618 # Option "XkbOptions" "ctrl:nocaps"
619 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/XKB-Config.html
620 Section "InputDevice"
621 Identifier "Keyboard0"
622 Option "CoreKeyboard"
626 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/mouse.html
633 Identifier "Monitor0"
634 # ModelName "Old Monitor (no DDC)"
636 # HorizSync 28.0 - 78.0 # Warning: This may fry very old Monitors
637 # HorizSync 28.0 - 96.0 # Warning: This may fry old Monitors
639 # VertRefresh 50.0 - 76.0 # Very conservative. May flicker.
640 # VertRefresh 50.0 - 60.0 # Extreme conservative. Will flicker. TFT default.
642 # Need more information?
643 # http://xtiming.sourceforge.net/cgi-bin/xtiming.pl
644 # http://en.tldp.org/HOWTO/XFree86-Video-Timings-HOWTO/
648 ### Available Driver options are:
649 ## sw_cursor is needed for some ati and radeon cards
658 # Option "RenderAccel" "true"
659 # Option "AllowGLXWithComposite" "true"
661 # The following line is auto-generated by grml-x
665 ## Workaround for drivers which send output to wrong device:
666 # Option "MonitorLayout" "LVDS, AUTO"
667 # Option "MonitorLayout" "LVDS, CRT"
668 # Option "MonitorLayout" "NONE, STV"
669 # Option "MonitorLayout" "LVDS"
713 #Section "Extensions"
714 # Option "Composite" "Enable"
717 ## END OF FILE #################################################################
724 XCONFTMP="/tmp/xconfig.$$"
726 [ -f $XCONFIG ] && sudo mv -f $XCONFIG $XCONFIG.old
727 sudo mv $XCONFTMP $XCONFIG
728 sudo chown root.root $XCONFIG
729 sudo chmod 644 $XCONFIG
736 if [[ ! -f $XCONFIG ]] ; then
737 print -n "$bold_color$fg[blue]Creating $XCONFIG: $fg[red]"
738 writeit && print "$fg[green]done$reset_color"
740 print "$bold_color$fg[blue]Notice: $XCONFIG exists already.
741 Use the force-option (-force) to force creation.
744 if [[ -n "$FORCE" ]] ; then
745 print "$bold_color$fg[blue]Force-switch or manual option(s) detected -"
746 print -n "moving eventual existing $XCONFIG to ${XCONFIG}.old: $fg[red]"
747 writeit && print "$fg[green]done$reset_color"
756 if [ -z $NOSTART ] ; then
758 if [ -x /etc/init.d/xorg-common ] ; then
759 sudo /etc/init.d/xorg-common start
761 if [ -x /etc/init.d/xfree86-common ] ; then
762 sudo /etc/init.d/xfree86-common start
766 if [ -z $DISPLAY ] ; then
767 print "$bold_color$fg[green]Now trying to run startx.$reset_color"
768 startx ~/.xinitrc -- $XOPTS
770 print "$bold_color$fg[green]Now trying to run startx on display $DISPLAY.$reset_color"
771 startx ~/.xinitrc -- :$DISPLAY $XOPTS
774 print "$bold_color$fg[blue]Not running startx as requested as option.$reset_color"
784 if [ $UID != 0 ] ; then
785 if [[ $(tty) == /dev/pts/* ]] ; then
786 print "It seems you are running $PROGRAMNAME from inside GNU screen.
787 Notice that this might fail if running as user grml!
788 Please exit screen and try to run $PROGRAMNAME again."
792 Problems? Run the following commands for getting information on your hardware:
794 discover -v --data-path=xfree86/server/device/driver display
795 xdebconfigurator -c -d -i -x
796 get-edid | parse-edid
798 Do you want to go the debian way of life? Run:
799 apt-get install x-window-system-core read-edid mdetect hwinfo xdebconfigurator
800 dpkg-reconfigure x-window-system-core (or xserver-xfree86 or xserver-xorg depending on your system)
802 Problems with the module used for X? Try to load another one or
803 fall back to module vesa:
804 $PROGRAMNAME -module radeon ...
805 $PROGRAMNAME -module vesa ...
807 Do you want to deactivate a present synaptics touchpad? Run:
808 $PROGRAMNAME -nosynaptics ...
810 Your monitor is very old and/or does not support DDC-probing?
811 $PROGRAMNAME -noddc ...
813 Do you want to create a x configuration file but do not start X?
814 $PROGRAMNAME -nostart ...
816 Monitor frequency too high or too low? Just specify hsync/vsync manually:
817 $PROGRAMNAME -hsync 30-65 ...
818 $PROGRAMNAME -hsync 30-65 -vsync 50-60 ...
820 Want to adjust the resolution? Use the mode-switch:
821 $PROGRAMNAME -mode 1024x768 ...
822 $PROGRAMNAME -mode '1280x1024 1024x768' ...
824 To adjust resolution while running X execute:
827 More information on grml-x can be found in the manual page: man grml-x
829 Report bugs, send wishes and feedback to the grml team:
830 http://grml.org/bugs/ - contact (at) grml.org
832 print -n "$reset_color"
848 if [ -w $XINITRC ] ; then
849 sed -i "s|^[^#]*exec.*| exec $WINDOWMANAGER|g" $XINITRC
852 echo -e "#!/bin/sh\n exec $WINDOWMANAGER" >> $XINITRC
857 ## END OF FILE #################################################################
858 # vim:foldmethod=marker