/usr/share/xresprobe/ddcprobe.sh is in xresprobe 0.4.24ubuntu9.
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 | #!/bin/sh
# Copyright (C) 2004 Canonical Ltd.
# Author: Daniel Stone <daniel.stone@ubuntu.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License with
# the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL-2;
# if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
#
# On Debian systems, the complete text of the GNU General Public
# License, version 2, can be found in /usr/share/common-licenses/GPL-2.
BLACKLISTMODES="2288x1430"
if [ -n "$1" ]; then
DDCPROBE="$(cat $1)"
else
DDCPROBE="$(ddcprobe 2>/dev/null)"
fi
if [ "$?" = "1" ]; then
exit 1
fi
if (echo "$DDCPROBE" | egrep "(edidfail|ddcfail)" >/dev/null 2>&1); then
exit 0
fi
if (echo "$DDCPROBE" | egrep "^input: .*digital"); then
SCREENTYPE="lcd"
else
# Not necessarily true, as lcds can be connected as analog too
SCREENTYPE="crt"
fi
TIMINGS="$(echo "$DDCPROBE" | egrep '^[cd]*timing:' | \
sed -e 's/^[cd]*timing: \([^x]*\)x\([^ @$]*\).*$/\1x\2/;' | \
sort -nr | egrep -v "$BLACKLISTMODES")"
TIMINGS="$(echo "$TIMINGS" | sort -rnu -tx -k1,1nr -k2,2nr)"
MONITORNAME="$(echo "$DDCPROBE" | egrep '^monitorname:' | sed -e 's/^monitorname: //;')"
MONITORRANGE="$(echo "$DDCPROBE" | egrep '^monitorrange:' | sed -e 's/^monitorrange: //;' -e 's/\,//;')"
echo "res: $(echo $TIMINGS | xargs echo)"
echo "displaytype: $SCREENTYPE"
echo "name: $MONITORNAME"
echo "freq: $MONITORRANGE"
|