1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#! /bin/sh i=1 while [ ! -e /sys/kernel/debug/vgaswitcheroo/switch ] do sleep 1 i=$(( $i + 1 )) if [ "$i" -eq "10" ] then exit ; fi done if [ "$(check_active_gpu.sh)" == "IGD" ]; then echo DIGD > /sys/kernel/debug/vgaswitcheroo/switch echo OFF > /sys/kernel/debug/vgaswitcheroo/switch fi