IceWalkers.com - Linux Software downloads and news
Name : Password :
Linux SoftwareLinux RPMLinux HowtosLink UsAboutAdvertise

Linux XFree-to-Xinside mini-HOWTO

Search Howtos :Match :
Next Previous Contents

6. Automating the process

This small script automates most of the work. Be very careful with the ScanType and with the two Polarity lines: the script do not set them and, if you are too lazy to correct them, the risks of blowing up your monitor increase quite a lot.

Notice that I don't know if the 'Doublescan' flag has meaning in XInside: if you try to convert a low-res doublescan mode BE CAREFUL, you can easily kill your monitor since the refresh rate that you get is doubled ( in fact my 400x300 at 72Hz became a 400x300 at 144Hz !).

#!/bin/sh
##########################################################################
# XF2XInside
#
# This script converts modelines from XF86Config format to XInside
# format as needed for the etc/Xtiming file.
#
# This is a quick hack, so don't expect much error checking (not to
# speak of anything like user friendlyness).
#
# If you call it without arguments it should tell you what to do.
#
#                               ( July 1996, hcz at tazlwurm.bb.bawue.de)
#
# Btw: New modes created as described in the HOWTO work, but don't
# show up in Xsetup's menu. Anybody who knows why?
#
##########################################################################
#----------------------------------------------- Here we go:
# Change this if your modeline file lives somewhere else:
XF=/usr/X11/lib/X11/XF86Config
if [ $# -ne 1 ] ; then
  echo "usage: ${0##*/} <mode>"
  echo " example: ${0##*/} 1024x764"
  echo -e " function: converts $XF modeline entry into\n Xinside Format (stdout)"
  exit 1
fi
egrep -i "^[\t ]*modeline.+\"$1\""  /usr/X11/lib/X11/XF86Config |
gawk '
NF < 11  { print "! invalid Modeline:\n! " $0 "\n!"; next }
{
  print "//", $0  ":"
  name = $2
  DOT_CLK = $3;
  A = $4;
  B = $5;
  C = $6;
  D = $7;
  a = $8;
  b = $9;
  c = $10;
  d = $11;
  VerFrequency =  1000000 / ((D / DOT_CLK) * d)
  print "[PREADJUSTED_TIMING]"
  printf "  PreadjustedTimingName = \"%dx%d  at  %.0dHz\";\n", A, a, VerFrequency
  print "  HorPixel\t\t= " A ";"
  print "  VerPixel\t\t= " a ";"
  print "  PixelWidthRatio\t= 4;\n  PixelHeightRatio\t= 3;"
  print "  HorFrequency\t\t= " DOT_CLK / D * 1000 ";\t// kHz"
  print "  VerFrequency\t\t= " VerFrequency  ";\t// Hz"
  print "  ScanType\t\t= NONINTERLACED;\t\t// *CHECK*"
  print "  HorSyncPolarity\t= NEGATIVE;\t\t\t// *CHECK*"
  print "  VerSyncPolarity\t= NEGATIVE;\t\t\t// *CHECK*"
  print "  CharacterWidth\t= 8;"
  print "  PixelClock\t\t= " DOT_CLK ";"
  HorTotalTime = D / DOT_CLK
  print "  HorTotalTime\t\t= " HorTotalTime ";"
  print "  HorAddrTime \t\t= " A / DOT_CLK ";"
  print "  HorBlankStart\t\t= " A / DOT_CLK ";"
  print "  HorBlankTime\t\t= " D / DOT_CLK - A / DOT_CLK ";"
  print "  HorSyncStart\t\t= " B / DOT_CLK ";"
  print "  HorSyncTime\t\t= " C / DOT_CLK - B / DOT_CLK ";"
  VerTotalTime  = ( HorTotalTime * d ) / 1000
  print "  VerTotalTime\t\t= " VerTotalTime ";"
  print "  VerAddrTime\t\t= " ( HorTotalTime * a ) / 1000 ";"
  VerBlankStart = ( HorTotalTime * a ) / 1000
  print "  VerBlankStart\t\t= " VerBlankStart ";"
  print "  VerBlankTime\t\t= " VerTotalTime - VerBlankStart ";"
  print "  VerSyncStart\t\t= " ( HorTotalTime * b ) / 1000 ";"
  print "  VerSyncTime\t\t= " ( HorTotalTime * ( c - b ) ) / 1000
  print ""
}'


Next Previous Contents
Search Howtos :Match :
My Money 2.0.53
Personal financial software
Deluge 1.2.2
Bittorrent client written in Python and GTK+
DbVisualizer 7.0.5
The Universal Database Tool
Linux Kernel 2.6 2.6.34-rc2
Linux Kernel
Postfix 2.6.6
Alternative to the Sendmail program
ImageMagick 6.6.0-7
ImageMagick image processing studio
Phorum 5.2.15
Web based discussion software written in PHP.
Gnucash 2.3.13
A full-featured application to keep track of your finances.
Wine 1.1.41
Free implementation of Windows on Unix
NVidia driver 195.36.15
Linux unified nVidia driver
Free IT Magazines, White Papers, eBooks, and more !
Oracle Magazine

Contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more.

Vulnerability Management for Dummies

Get all the Facts and See How to Implement a Successful Vulnerability Management Program.

Website Magazine

Has tapped premier talent in the Internet industry for our content and each and every issue will contain practical advice and insights for website owners.

Linux Software Map
Find Linux RPM
Best Rated Linux Software
Most Rated Linux Software
Linux Distributions
Linux Howtos
Quick Survey

Please take our survey and help us improve our website to serve you better.

Thank you.
Linux Software
Linux / IT Resources
Site Resources
Google
Privacy Policy
Contact Us
Submit Software
Advertising info