aboutsummaryrefslogtreecommitdiff
path: root/xrandr-monitor.sh
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2020-08-04 14:42:00 +0200
committerToni Uhlig <matzeton@googlemail.com>2020-08-04 14:42:00 +0200
commit72324466eb07101ce37a6df662857e76e8f7d693 (patch)
tree6823ce34f820b7809cac00b52e831eda74effe30 /xrandr-monitor.sh
parent147ebb72562074cd55281e1f276f2400cc1f8ee8 (diff)
changeable checksum-tool
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'xrandr-monitor.sh')
-rwxr-xr-xxrandr-monitor.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/xrandr-monitor.sh b/xrandr-monitor.sh
index ce54224..99f470b 100755
--- a/xrandr-monitor.sh
+++ b/xrandr-monitor.sh
@@ -2,13 +2,14 @@
set -e
+CHKSM_BIN=md5sum
MONITORS=$(xrandr --query | grep -oE '^[a-zA-Z0-9\-]{3,8} connected' | cut -d ' ' -f 1)
GET_BY_CHKSM=${1:-}
GOT_MONITOR=0
for mon in ${MONITORS}; do
EDID=$(xrandr --props | grep "^${mon}" -A 10 | grep -oE '[a-fA-F0-9]{32}')
- EDID_CHKSM=$(printf "%s" "${EDID}" | sha512sum | cut -d ' ' -f 1)
+ EDID_CHKSM=$(printf "%s" "${EDID}" | ${CHKSM_BIN} | cut -d ' ' -f 1)
if [ "x${GET_BY_CHKSM}" = "x${EDID_CHKSM}" ]; then
printf "%s" "${mon}"
@@ -17,7 +18,7 @@ for mon in ${MONITORS}; do
printf "Monitor: '%s'\n" "${mon}"
if [ "x${EDID}" != x ]; then
printf "[EDID]\n%s\n" "${EDID}"
- printf "Chksm: %s\n" $(printf "%s" "${EDID}" | sha512sum | cut -d ' ' -f 1)
+ printf "Chksm: %s\n" $(printf "%s" "${EDID}" | ${CHKSM_BIN} | cut -d ' ' -f 1)
fi
fi
done