home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / share / xresprobe / xprobe.sh < prev   
Encoding:
Linux/UNIX/POSIX Shell Script  |  2007-03-17  |  1.6 KB  |  52 lines

  1. #!/bin/sh
  2. # usage: xprobe.sh driver
  3. # Copyright (C) 2004 Canonical Ltd.
  4. # Author: Daniel Stone <daniel.stone@ubuntu.com>
  5. #  This program is free software; you can redistribute it and/or modify
  6. #  it under the terms of the GNU General Public License as published by
  7. #  the Free Software Foundation; version 2 of the License.
  8. #
  9. #  This program is distributed in the hope that it will be useful,
  10. #  but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. #  GNU General Public License for more details.
  13. #
  14. #  You should have received a copy of the GNU General Public License with
  15. #  the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL-2;
  16. #  if not, write to the Free Software Foundation, Inc., 59 Temple Place,
  17. #  Suite 330, Boston, MA  02111-1307  USA
  18. #
  19. # On Debian systems, the complete text of the GNU General Public
  20. # License, version 2, can be found in /usr/share/common-licenses/GPL-2.
  21.  
  22. DATAPATH="/usr/share/xresprobe"
  23.  
  24. DRIVER="$1"
  25. if [ -z "$DRIVER" ]; then
  26.   echo "Driver name must be specified on the command line."
  27.   exit 1
  28. fi
  29.  
  30. set -e
  31. if [ -z "$TMPDIR" ]; then
  32.     TMPDIR="/tmp"
  33. fi
  34. XDIR="$TMPDIR/xprobe.$$"
  35. TMPCONF="$XDIR/xorg.conf"
  36. TMPLOG="$XDIR/xorg.log"
  37. TMPOUT="$XDIR/xorg-stdout.log"
  38.  
  39. mkdir -m700 "$XDIR"
  40. sed -e "s/::DRIVER::/$DRIVER/;" < "$DATAPATH/xorg.conf" > "$TMPCONF"
  41. set +e
  42.  
  43. if [ "$DRIVER" = "vesa" ]; then
  44.   /usr/bin/Xorg :67 -ac -probeonly -logfile "$TMPLOG" > "$TMPOUT" 2>&1
  45. else
  46.   /usr/bin/Xorg :67 -ac -probeonly -logfile "$TMPLOG" -config "$TMPCONF" > "$TMPOUT" 2>&1
  47. fi
  48.  
  49. echo "$XDIR"
  50. exit 0
  51.