Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ini file located in etc/
- case "${ACTION}" in
- "listModes")
- echo "$(</userdata/system/videomodes.conf)"
- xrandr --listModes | sed -e 's/\*$//' | sed -e 's/^\([^ ]*\) \(.*\)$/ \1:\2/' | sed -e "/\b\(SR\)\b/d"
- ;;
- "setMode")
- MODE=$1
- read WIDTH HEIGHT PARTHZ INI <<< $(echo $MODE | awk -F'[x.:]' '{print $1, $2, $3, $4, $5}')
- INI=$(echo "$INI" | sed 's/00//')
- if [[ ${INI} ]]; then
- switchres ${WIDTH} ${HEIGHT} ${PARTHZ} -f ${WIDTH}x${HEIGHT}@${PARTHZ} -i ${INI}.ini -s -k
- else
- switchres ${WIDTH} ${HEIGHT} ${PARTHZ} -f ${WIDTH}x${HEIGHT}@${PARTHZ} -s -k
- fi
- ;;
- "defineMode")
- MODE=$1
- read WIDTH HEIGHT PARTHZ INI <<< $(echo $MODE | awk -F'[x.:]' '{print $1, $2, $3, $4, $5}')
- RES_MODE="${WIDTH}x${HEIGHT}"
- if [[ ${INI} ]]; then
- MODE_switchres=$(switchres ${WIDTH} ${HEIGHT} ${PARTHZ} -f ${WIDTH}x${HEIGHT}@${PARTHZ} -i ${INI}) #> /dev/null 2>/dev/null
- else
- MODE_switchres=$(switchres ${WIDTH} ${HEIGHT} ${PARTHZ} -f ${WIDTH}x${HEIGHT}@${PARTHZ}) #> /dev/null 2>/dev/null
- fi
- MODELINE_CUSTOM=$(echo "$MODE_switchres" | sed -n 's/.*Modeline "[^"]*" \([0-9.]\+\) \([0-9 ]\+\) \(.*\)/\1 \2 \3/p')
- OUTPUT=$(xrandr --listConnectedOutputs | grep -E '\*$' | sed -e 's/\*$//' | head -1)
- xrandr -display :0.0 --newmode ${RES_MODE} ${MODELINE_CUSTOM}
- xrandr -display :0.0 --addmode ${OUTPUT} ${RES_MODE}
- ;;
- ini file located in /userdata/system/Batocera-CRT-Script/switchres_overrides/
- case "${ACTION}" in
- "listModes")
- echo "$(</userdata/system/videomodes.conf)"
- xrandr --listModes | sed -e 's/\*$//' | sed -e 's/^\([^ ]*\) \(.*\)$/ \1:\2/' | sed -e "/\b\(SR\)\b/d"
- ;;
- "setMode")
- MODE=$1
- read WIDTH HEIGHT PARTHZ INI <<< $(echo $MODE | awk -F'[x.:]' '{print $1, $2, $3, $4, $5}')
- INI=$(echo "$INI" | sed 's/00//' | tr -d '[:space:]')
- if [[ ${INI} ]]; then
- switchres ${WIDTH} ${HEIGHT} ${PARTHZ} -f ${WIDTH}x${HEIGHT}@${PARTHZ} -i /userdata/system/Batocera-CRT-Script/switchres_overrides/${INI}.ini -s -k
- else
- switchres ${WIDTH} ${HEIGHT} ${PARTHZ} -f ${WIDTH}x${HEIGHT}@${PARTHZ} -s -k
- fi
- ;;
- "defineMode")
- MODE=$1
- read WIDTH HEIGHT PARTHZ INI <<< $(echo $MODE | awk -F'[x.:]' '{print $1, $2, $3, $4, $5}')
- RES_MODE="${WIDTH}x${HEIGHT}"
- if [[ ${INI} ]]; then
- MODE_switchres=$(switchres ${WIDTH} ${HEIGHT} ${PARTHZ} -f ${WIDTH}x${HEIGHT}@${PARTHZ} -i /userdata/system/Batocera-CRT-Script/switchres_overrides/${INI}) #> /dev/null 2>/dev/null
- else
- MODE_switchres=$(switchres ${WIDTH} ${HEIGHT} ${PARTHZ} -f ${WIDTH}x${HEIGHT}@${PARTHZ}) #> /dev/null 2>/dev/null
- fi
- MODELINE_CUSTOM=$(echo "$MODE_switchres" | sed -n 's/.*Modeline "[^"]*" \([0-9.]\+\) \([0-9 ]\+\) \(.*\)/\1 \2 \3/p')
- OUTPUT=$(xrandr --listConnectedOutputs | grep -E '\*$' | sed -e 's/\*$//' | head -1)
- xrandr -display :0.0 --newmode ${RES_MODE} ${MODELINE_CUSTOM}
- xrandr -display :0.0 --addmode ${OUTPUT} ${RES_MODE}
- ;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement