requires cvt12 for reduced blanking (better 'overclock'):
Code:
koko@Gozer# cat scripts/refresh.rate.custom.sh #!/bin/bash if [ ! $# = 3 ] ; then echo "Usage: $(basename $0) <WxH> <Refresh> <Output name or ALL>" echo Example: $(basename $0) 1280x1024 75 ALL echo Example: $(basename $0) 1280x1024 75 DVI-D-0 exit fi w=$(cut -d "x" -f 1 <<< "$1") h=$(cut -d "x" -f 2 <<< "$1") output=$3 hz=$2 #Genera la modeline #GTF_OUT=$(gtf $w $h $hz|grep Modeline) GTF_OUT=$(cvt12 $w $h $hz -b |grep Modeline) MODE_NAME=koko_"$w"x"$h"_"$hz" TIMINGS=$(echo $GTF_OUT|grep Modeline|cut -d \" -f 3) MODELINE="$MODE_NAME $TIMINGS" echo $MODELINE #aggiungo al pool: xrandr --newmode $MODELINE #Aggiunge e setta il modo custom a tutti i monitor if [ $output = "ALL" ] ; then MONITORS=$(xrandr|grep " conne"|cut -d " " -f 1|tr \\n " ") else MONITORS=$output fi for MONITOR in $MONITORS ; do xrandr --addmode $MONITOR $MODE_NAME xrandr --output $MONITOR --mode $MODE_NAME done sleep 1 echo "Press a key in 5 seconds to keep settings" read -n 1 -t 5 if [ ! $? == 0 ]; then #Cleanup: for MONITOR in $MONITORS ; do xrandr --output $MONITOR --preferred xrandr --delmode $MONITOR $MODE_NAME xrandr --rmmode $MODE_NAME xrandr --output HDMI2 --left-of HDMI1 done fi
Leave a comment: