better way that works in multi monitor setups

This commit is contained in:
Andrew Titmuss 2016-06-15 21:02:33 +10:00
parent cd51987f17
commit df1e73a6b0
No known key found for this signature in database
GPG Key ID: 8AF42975C787E0B2
1 changed files with 6 additions and 8 deletions

View File

@ -1538,15 +1538,13 @@ getresolution () {
awk '/Resolution:/ {printf $2"x"$4" @ "$6"Hz, "}')"
fi
if [ "$refresh_rate" == "off" ] || [ "${resolution// * @ }" == "0Hz" ]; then
IFS=","
for res in $resolution; do
res="${res// @ *[0-9]Hz}"
newres="$newres, $res"
done
unset IFS
resolution="${newres:2}"
if [ "$refresh_rate" == "off" ]; then
resolution="${resolution// @ [0-9][0-9]Hz}"
resolution="${resolution// @ [0-9][0-9][0-9]Hz}"
fi
[[ "$resolution" =~ "0Hz" ]] && \
resolution="${resolution// @ 0Hz}"
;;
"Windows")