/usr/bin/some_modes is in videogen 0.33-4.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | #!/bin/bash
# +-----------------------------------------------------------+
# | |
# | Use this script to generate some mode lines automatically |
# | with videogen. |
# | |
# | (c) Szabolcs Rumi, 1997-2001 |
# | |
# +-----------------------------------------------------------+
# you may change this to the location of the videogen program
VIDEOGEN="${VIDEOGEN=videogen} -f=/dev/null"
# set this to the maximum dot clock your video card can generate [MHz]
DOTCLOCK="225"
DEF_DOTCLOCK=$DOTCLOCK
# set this to the maximum horizontal refresh rate of your monitor [kHz]
HORIZ="64"
DEF_HORIZ=$HORIZ
# set this to the maximum vertical refresh rate of your monitor [Hz]
VERT="120"
DEF_VERT=$VERT
# set this to the minimum horizontal sync pulse length of your monitor [us]
MINSYNC="0.5"
DEF_MINSYNC="0.5"
# set this to emit mode lines compatible with the non-free NVidia driver
NVIDIA="yes"
# load your previous settings
if test -f ~/.videogenrc ; then
. ~/.videogenrc
fi
if test -z "$DIALOG" ; then
which dialog > /dev/null && DIALOG=dialog
which whiptail > /dev/null && DIALOG=whiptail
which gdialog > /dev/null && DIALOG=gdialog
fi
if test -z "$DIALOG" ; then
echo "$0: no dialog program found, unable to continue" 1>&2
exit 1
fi
# The dialog part
tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
trap "rm -f $tempfile" 0 1 2 5 15
$DIALOG \
--title "GENERAL WARNING" --clear --yesno \
"WARNING! WARNING! WARNING!
THE USE OF THIS PROGRAM CAN CAUSE PERMANENT DAMAGE TO YOUR MONITOR AND/OR VIDEO CARD. IF YOU ARE NOT SURE WHAT YOU ARE DOING, HIT 'NO' NOW, OTHERWISE, HIT 'YES' TO CONTINUE.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE SOFTWARE AUTHOR(s) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." 22 70 || exit 1
$DIALOG \
--title "HINTS" --clear --msgbox \
"There are no perfect modelines for all monitors.
There are many monitors that can be damaged by using wrong and non-standard modes, so better make sure that it will power-off if an invalid mode is tried.
Note that when the initial set of Modeline has been generated and you run X, you can use xvidtune for fine configuration. Using xvidtune's 'auto' mode, you can find the best working timing values, than you can hit 'show' to dump them to the console and replace the values of that Modeline with the dumped numbers." 20 60
$DIALOG \
--title "INPUT BOX" --clear \
--inputbox "Please enter the maximum dot clock your video card can generate [MHz]. (default: $DEF_DOTCLOCK)" 10 51 $DOTCLOCK 2> $tempfile
retval=$?
case $retval in
0)
read DOTCLOCK < $tempfile || exit 1;;
*)
exit 1;;
esac
$DIALOG \
--title "INPUT BOX" --clear \
--inputbox "Please enter the maximum horizontal refresh rate of your monitor [kHz]. (default: $DEF_HORIZ)" 10 51 $HORIZ 2> $tempfile
retval=$?
case $retval in
0)
read HORIZ < $tempfile || exit 1;;
*)
exit 1;;
esac
$DIALOG \
--title "INPUT BOX" --clear \
--inputbox "Please enter the maximum vertical refresh rate of your monitor [Hz]. (default: $DEF_VERT)" 10 51 $VERT 2> $tempfile
retval=$?
case $retval in
0)
read VERT < $tempfile || exit 1;;
*)
exit 1;;
esac
$DIALOG \
--title "INPUT BOX" --clear \
--inputbox "Please enter the minimum horizontal sync pulse length of your monitor [us]. (default: $DEF_MINSYNC)" 10 51 $MINSYNC 2> $tempfile
retval=$?
case $retval in
0)
read MINSYNC < $tempfile || exit 1;;
*)
exit 1;;
esac
if test "$NVIDIA" = "yes" ; then
NV=""
else
NV="--defaultno"
fi
if $DIALOG $NV \
--title "NVIDIA COMPATIBILITY" --yesno "The non-free Nvidia drivers available from www.nvidia.com require small changes in calculating algorithm. Without them, many Modelines are not accepted by the driver. Should videogen try to make compatible lines?" 10 51 2> $tempfile ; then
VIDEOGEN="$VIDEOGEN -nv"
NVIDIA="yes"
else
VIDEOGEN="$VIDEOGEN -nnv"
NVIDIA="no"
fi
rm -rf ~/.videogenrc
(cat <<EOF
export DOTCLOCK="$DOTCLOCK"
export HORIZ="$HORIZ"
export VERT="$VERT"
export MINSYNC="$MINSYNC"
export NVIDIA="$NVIDIA"
EOF
) | tee ~/.videogenrc
# these lines were inserted to warn you not to forget to change the above vars
# which are set to my hardware parameters by default
tput bold 2>/dev/null
echo '+-----------------------------------------------------------------------+'
echo '| |'
echo '| To configure X, edit /etc/X11/xorg.conf. Locate the "Monitor" |'
echo '| section and place the generated Modeline lines there. See the |'
echo '| manpage xorg.conf(5) for more details. |'
echo '| |'
echo '| To setup the framebuffer, pass the generated timing lines to "fbset" |'
echo '| directly, or enter them into /etc/fb.modes. Take a look at the |'
echo '| manpages fbset(1) and fb.modes(5) to see what this is about. |'
echo '| |'
# videogen requires the minimum horizontal sync to be in the range [0.3..1.5]
if [ "`echo \"10 * $MINSYNC\" | bc | cut -f1 -d.`" -lt 3 ] ; then
MINSYNC=$DEF_MINSYNC
echo "| NOTE: Chosen minimal horizontal sync value is too low, choosing $MINSYNC! |"
echo '| |'
elif [ "`echo \"10 * $MINSYNC\" | bc | cut -f1 -d.`" -gt 15 ] ; then
MINSYNC=$DEF_MINSYNC
echo "| NOTE: Chosen minimal horizontal sync value is too high, choosing $MINSYNC! |"
echo '| |'
fi
echo '+-----------------------------------------------------------------------+'
tput sgr 0 2>/dev/null # turn off bold mode
# these are the lines printing out the main thing
for M in "" "-fb" ; do
for R in 640x400 640x480 800x600 1024x768 1152x864 1280x960 \
1280x1024 1600x1200 ; do
$VIDEOGEN $M -m=$R -mdc=$DOTCLOCK -mhf=$HORIZ -mvf=$VERT -hsp=$MINSYNC
done
done
# EOF
|