From: paperbenni Date: Sun, 30 Aug 2020 20:47:04 +0000 (+0200) Subject: fix nvidia card display lag X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=73b258587654b85739ce761a10e6a5c2a90fb17b;p=instantos%2FinstantOS.git fix nvidia card display lag --- diff --git a/autostart.sh b/autostart.sh index 4aa3e4f..03bd873 100755 --- a/autostart.sh +++ b/autostart.sh @@ -311,7 +311,14 @@ done & # auto open menu when connecting/disconnecting monitor if ! (iconf -i noautoswitch && iconf -i islaptop) || iconf -i autoswitch; then - DISPLAYCOUNT="$(xrandr | grep -c '[^s]connected')" + + if nvidia-xconfig --query-gpu-info + then + DISPLAYCOUNT="$(nvidia-xconfig --query-gpu-info | grep -oi 'number of dis.*' | grep -o '[0-9]*')" + else + DISPLAYCOUNT="$(xrandr | grep -c '[^s]connected')" + fi + if [ "$DISPLAYCOUNT" -eq "$DISPLAYCOUNT" ]; then while :; do NEWDISPLAYCOUNT="$(xrandr | grep -c '[^s]connected')"